Repository navigation
feat(auto-routing): custom router web API, editor, and catalog - #7790
Conversation
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Executive SummaryCommit Overview
Issue Details (click to expand)WARNING
Verification Notes
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous Review Summaries (6 snapshots, latest commit c70847f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c70847f)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryCommit Overview
Issue Details (click to expand)WARNING
SUGGESTION
Verification Notes
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit e870f13)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe new commit Overview
Issue Details (click to expand)WARNING
SUGGESTION
Verification Notes
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Previous review (commit 26c9e69)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe incremental diff for this revision is empty — all 20 changed PR files are content-identical to the previously reviewed commit Overview
Issue Details (click to expand)WARNING
Verification Notes
Files Reviewed (20 files)
Fix these issues in Kilo Cloud Previous review (commit 3de2f0a)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental changes (contract Files Reviewed (5 files)
Verification Notes
Previous review (commit 5cf9a43)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Previous review (commit 182a80c)Status: 5 Issues Found | Recommendation: Address before merge Executive SummaryThe server correctly derives ownership, enforces org access and subscription checks, and scopes every query by owner; the main risks are a per-owner advisory-lock transaction that spans outbound HTTP, a UI error guard that can discard already-loaded data, and an optional catalog annotation that can fail the whole models endpoint. Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (16 files)
Reviewed by deepseek-v4.1-flash · Input: 44K · Output: 5.8K · Cached: 350.8K Review guidance: REVIEW.md from base branch |
…den catalog and card
…re benchmark admission
3de2f0a to
26c9e69
Compare
Summary
Web app slice of ADR 0005 (custom auto routers). This PR adds:
It is gated by the PostHog flag
kilo-auto-custom-routers.REST API (
/api/auto-routing/custom-routers)AUTO_ROUTING_CUSTOM_ROUTERS_PATH,customRouterPath,customRouterClientEntriesPath, and the request and response schemas).GETlists routers.POSTcreates one.GET,PATCH, andDELETEwork on/{scope}/{slug}.POSTandDELETEon/{scope}/{slug}/client-entriesregister and remove client entries. The CLI uses these.CustomRouterErrorResponseSchema, and every response status comes from the contract HTTP status table.getUserFromAuthaccepts both a web session and a Kilo user bearer token.X-KiloCode-OrganizationId.?organizationId=instead.ensureOrganizationAccess.ORGANIZATION_BILLING_ROLES(owner, admin, billing manager). It also needs an active subscription or trial. Other members get read-only summaries withcanEdit: false.orgslug, 1–20 unique entries, and that the default entry is in the pool./admin/profiles/register), in batches of 10, withrouter = baseRouter.quota_exceeded(HTTP 429), and the error object carriesretryAt.CUSTOM_ROUTER_STATUS_PATHwithCustomRouterBenchmarkContextSchema).clientEvalEntryKeyslists every client entry and every direct-BYOK gateway entry. This is the same rule the serving worker uses.needsClientEvalis true when the CLI must evaluate the entry and not every variant isreadyunder the current engine identity.variantsfor each entry.UI
CustomRoutersCardwith a create/edit dialog.kilo auto evalcommand.AutoRoutingModeCardis unchanged.Catalog
/api/openrouter/modelsnow lists the flagged user's routers:kilo-auto/custom/<slug>,kilo-auto/custom/org/<slug>.customRouterAutoModelfrom the base router's auto model. ItsautoRouting.modelslists the gateway entries visible in the caller's catalog.Flag
kilo-auto-custom-routersis evaluated per user, with a strict boolean check (isReleaseToggleEnabled); it is always on in development.router_not_found(404) on every route. Their routers do not appear in the catalog.Dependencies
CUSTOM_ROUTER_STATUS_PATHroute and frontier admission come in the benchmark worker PR of this stack. Until that deploys, the list returns empty variants for each entry, and creating a router fails when the worker rejects admission.kilo-auto/custom/*and removal of the old pool settings come in later stacked PRs.Verification
On a work VM:
pnpm typecheckpasses inpackages/web-sharedandapps/web.pnpm lintpasses inapps/web.src/app/api/auto-routing/**, including the new custom router route tests, which run against the real database,src/tests/openrouter-models.test.ts,auto-routing-models,handlers/models,handlers/organization-models,auto-routing-benchmark-admin-client, anddirect-byoktests.oxfmtreports no changes on the changed files.