Skip to content

fix(ai-gateway): filter training-enabled models for Teams orgs#4066

Open
chrarnoldus wants to merge 4 commits into
mainfrom
fix/teams-filter-data-collection-models
Open

fix(ai-gateway): filter training-enabled models for Teams orgs#4066
chrarnoldus wants to merge 4 commits into
mainfrom
fix/teams-filter-data-collection-models

Conversation

@chrarnoldus

@chrarnoldus chrarnoldus commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Filter the shared organization model catalog when a Teams organization denies data collection.
  • Exclude enhanced gateway models whose mayTrainOnYourPrompts metadata is true, while retaining models that do not require data collection.
  • Add regression coverage for organization-aware /models endpoints.

Verification

  • Not manually tested; this change affects server-side model catalog filtering.

Visual Changes

N/A

Reviewer Notes

Experiment models remain excluded by the existing data-collection policy. Direct BYOK and custom LLM models remain outside this filter because they are explicitly configured by organization administrators and appended after gateway catalog filtering.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Jun 17, 2026
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot

kilo-code-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of 25+ files across multiple domains: auto-routing benchmark org context, efficient auto model publishing, GLM variant fix, MiniMax M3 scoping, review-fix session rewrite, and gateway mirror cleanup. All changes are internally consistent, properly tested, and correct.

Files Reviewed (34 files)
  • apps/web/src/lib/organizations/organization-models.ts — Teams data-collection filtering (previously reviewed)
  • apps/web/src/routers/organizations/organization-settings-router.test.ts — Regression test (previously reviewed)
  • services/auto-routing-benchmark/container/server.mjs — Container adds kiloApiUrl/orgId with validation
  • services/auto-routing-benchmark/migrations/0001_special_yellow_claw.sql — Adds benchmark_org_id (safe ALTER)
  • services/auto-routing-benchmark/migrations/meta/0001_snapshot.json — Migration snapshot
  • services/auto-routing-benchmark/migrations/meta/_journal.json — Migration journal
  • services/auto-routing-benchmark/src/admin.test.ts — Admin test updates
  • services/auto-routing-benchmark/src/admin.ts — Admin routes pass org context to debug CLI
  • services/auto-routing-benchmark/src/cli-runner.test.ts — CLI runner orgId tests
  • services/auto-routing-benchmark/src/cli-runner.ts — CLI runner adds kiloApiUrl/orgId params
  • services/auto-routing-benchmark/src/config.test.ts — Config test updates
  • services/auto-routing-benchmark/src/config.ts — Config mapping/storage for benchmarkOrgId
  • services/auto-routing-benchmark/src/db-schema.ts — Schema adds benchmark_org_id columns
  • services/auto-routing-benchmark/src/db.test.ts — DB test updates
  • services/auto-routing-benchmark/src/db.ts — DB queries include benchmark_org_id
  • services/auto-routing-benchmark/src/run-process-job.test.ts — Process job test updates
  • services/auto-routing-benchmark/src/run.ts — Decider jobs pass org context to token mint and CLI
  • services/auto-routing-benchmark/README.md — Docs for benchmarkOrgId
  • apps/web/src/app/api/internal/auto-routing-benchmark/token/route.test.ts — Org-scoped token test
  • apps/web/src/app/api/internal/auto-routing-benchmark/token/route.ts — Org-scoped token minting with membership validation
  • apps/web/src/app/api/openrouter/[...path]/route.test.ts — Efficient classifier shadow test
  • apps/web/src/app/api/openrouter/[...path]/route.ts — Removes mirror scheduling, renames hints variable
  • apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.test.ts — Review fix route tests
  • apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.ts — Review fix session rewrite with proper error handling
  • apps/web/src/lib/ai-gateway/auto-model/index.ts — Removes status field, efficient becomes public
  • apps/web/src/lib/ai-gateway/auto-routing-benchmark-admin-client.test.ts — Test fixture update
  • apps/web/src/lib/ai-gateway/auto-routing-decision.ts — Absorbs buildDecidePayload from deleted mirror
  • apps/web/src/lib/ai-gateway/auto-routing-mirror.test.ts — Deleted
  • apps/web/src/lib/ai-gateway/auto-routing-mirror.ts — Deleted
  • apps/web/src/lib/ai-gateway/models.ts — Adds efficient to preferred models
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.ts — Scopes MiniMax thinking-disabled to M3 only
  • apps/web/src/lib/ai-gateway/providers/model-settings.ts — Moves GLM variants to none/high/xhigh group
  • apps/web/src/lib/ai-gateway/providers/openrouter/index.test.ts — Efficient model listing test
  • apps/web/src/lib/ai-gateway/providers/openrouter/index.ts — Removes status filter, all auto models now public
  • apps/web/src/lib/code-reviews/prompts/fix-review-prompt.ts — Fix-review prompt builder with shell-safe escaping

Fix these issues in Kilo Cloud

Previous Review Summary (commit b508b52)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit b508b52)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Adds data-collection filtering for Teams orgs with deny setting, with a clean regression test.

Files Reviewed (2 files)
  • apps/web/src/lib/organizations/organization-models.ts
  • apps/web/src/routers/organizations/organization-settings-router.test.ts

Reviewed by deepseek-v4-pro-20260423 · 1,118,883 tokens

Review guidance: REVIEW.md from base branch main

chrarnoldus and others added 2 commits June 17, 2026 18:00
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus changed the title fix(ai-gateway): filter team models requiring data collection fix(ai-gateway): filter training-enabled models for Teams orgs Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants