feat(ai-gateway): add organization auto model routing#4056
feat(ai-gateway): add organization auto model routing#4056pandemicsyn wants to merge 10 commits into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummarySingle commit addresses the previously flagged audit log issue by capturing Files Reviewed (2 incremental, 42 total)
Previous Review Summaries (5 snapshots, latest commit cf3f457)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit cf3f457)Status: No Issues Found | Recommendation: Merge Executive SummaryRefactors default model mutations to use Files Reviewed (42 files)
Previous review (commit 29a354e)Status: 1 Issue Found | Recommendation: Approve Executive SummaryRefactors the default model dialog and custom modes UI with a unified behavior endpoint (auto/specific/global). One minor suggestion: the audit log inside the transaction uses pre-transaction state for the global-reset case. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (9 files)
Fix these issues in Kilo Cloud Previous review (commit 412123c)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental changes cover a major tier-to-taxonomy refactoring across auto-routing contracts, decision engine, benchmarks, and admin UI, plus KiloClaw billing recovery UX, model catalog refresh for vision capabilities, cloud agent fork review flow, and CI/CD staging deployment. All changes are well-tested with no security, logic, or performance issues detected. Files Reviewed (40+ files changed since last review)
Previous review (commit b3107a9)Status: No Issues Found | Recommendation: Merge Executive SummaryThe previous WARNING about Files Reviewed (4 files changed since last review)
Previous review (commit 6e0261a)Status: 1 Issue Found | Recommendation: Address before merge Executive Summary
Overview
Issue Details (click to expand)WARNING
Files Reviewed (41 files)
Reviewed by deepseek-v4-pro-20260423 · 162,717 tokens Review guidance: REVIEW.md from base branch |
|
Fixed review feedback in b3107a9: BYOK ownership validation now accepts and uses the active transaction client inside Organization Auto settings/mode mutations. |
…ned-auto # Conflicts: # apps/web/src/app/api/openrouter/[...path]/route.ts
…ned-auto # Conflicts: # apps/web/src/lib/ai-gateway/providers/openrouter/index.ts
Summary
kilo-auto/org, an Enterprise-only Organization Auto model that lets an organization choose which model should handle each Kilo mode.organizations.settings.org_auto_model:buildusesroutes.buildbefore falling back toroutes.code, andplanusesroutes.planbefore falling back toroutes.architect.org-default-model-configmode-default rollout with the neworganization-auto-model-routingPostHog toggle for canonical organization-wide routing.OrganizationModeConfig.defaultModelbridge and stores all routing only inorganizations.settings.org_auto_model.Verification
/tmp/org-auto-api-log.shagainst a local service, including modes/defaults/models and optional gateway requests.Visual Changes
Reviewer Notes
org_auto_modelsettings, gateway resolution, BYOK ownership checks, route lifecycle consistency, and UI configuration.organization-auto-model-routing, replacing the oldorg-default-model-configtoggle. Runtime routing remains data-driven for already-configured organizations, and disable remains available during rollback.organization-auto-model-shared.tsexists specifically to keep client components from importing server-only DB/pg code.