Skip to content

[AISAGE-707] refactor(gateway): drop Kilo-exclusive model status in favor of the unavailable list - #7785

Merged
chrarnoldus merged 3 commits into
mainfrom
refactor/drop-kilo-exclusive-status
Oct 19, 2026
Merged

chrarnoldus merged 3 commits into
mainfrom
refactor/drop-kilo-exclusive-status

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Follow-up to #7773, which makes the unavailable list hide Kilo-exclusive models from the catalog.

Summary

Removes status: 'public' | 'hidden' | 'disabled' from KiloExclusiveModel. Every registered exclusive is now listed and usable unless its ID is on the unavailable list (the hard-coded list in unavailable-models.ts or the admin unavailable_models column). Unavailable models stay reachable through kilo-auto, because the gateway's unavailable check already skips auto-resolved requests.

  • hidden → unavailable. Gemma 4 26B free, the only hidden model, was already on the hard-coded unavailable list, so its behaviour is unchanged: not in the catalog, direct requests rejected, kilo-auto/small and kilo-auto/free still route to it.
  • disabled removed. isDisabledKiloExclusiveModel, shouldSuppressOpenRouterModel and the disabled rejection in llm-proxy.ts are gone. The only disabled entry, StepFun Step 5 Preview (free), is deleted from the registry.
  • Status checks replaced:
    • The catalog (openrouter/index.ts), provider sync (sync-providers.ts) and free-endpoint data policy now check the unavailable list.
    • The helpers, mapModelIdToVercel, is-free-model and ChatGPT routing no longer filter by status.
    • An OpenRouter model whose ID matches a registered exclusive is always replaced by the exclusive entry.
  • Efficient pool validation. The hidden_model reason is removed. Pools validate against the catalog, so unavailable models already fail as unknown_model.

Verification

  • jest across packages/web-shared/src/lib/ai-gateway, model-allow, organizations, the auto-routing libs and routes, and model-api-kinds: 121 suites, 2237 passed, 2 skipped.
  • jest on every changed test file plus the get-provider, auto-model, unavailable-models, provider sync and BYOK router suites: 26 suites, 697 passed. Changed test files rerun after rebasing onto current main: 15 suites, 529 passed.
  • pnpm --filter @kilocode/web-shared typecheck and tsgo --noEmit in apps/web: passed.
  • oxlint on changed files: 0 warnings, 0 errors.

@chrarnoldus chrarnoldus self-assigned this Oct 16, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Verified the removal of the status field from KiloExclusiveModel against the unavailable-list replacement: production call sites (openrouter/index.ts, sync-providers.ts, free-endpoint-data-policy.ts, llm-proxy.ts, is-free-model.ts, routing.ts, mapModelIdToVercel.ts) are consistent, no references to the deleted isDisabledKiloExclusiveModel/shouldSuppressOpenRouterModel/hidden_model/STEP_5_PREVIEW_FREE_MODEL_ID/stepfun_5_preview_free_model remain anywhere in the repo, and the hide-behaviour for the one previously hidden/disabled entries is preserved by the hard-coded unavailable list. No bugs, security issues, or memory leaks identified in the changed code.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (26 files)
  • apps/web/src/app/admin/api/auto-routing/benchmark-config/route.test.ts - 0 issues
  • apps/web/src/app/api/auto-routing/settings/route.test.ts - 0 issues
  • apps/web/src/lib/auto-routing-pool-validation.test.ts - 0 issues
  • apps/web/src/lib/auto-routing-pool-validation.ts - 0 issues
  • apps/web/src/lib/model-api-kinds.test.ts - 0 issues
  • apps/web/src/lib/providers/openrouter/free-endpoint-data-policy.test.ts - 0 issues
  • apps/web/src/lib/providers/openrouter/free-endpoint-data-policy.ts - 0 issues
  • apps/web/src/lib/providers/openrouter/sync-providers.ts - 0 issues
  • apps/web/src/tests/openrouter-models.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/handlers/llm-proxy.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/handlers/llm-proxy.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/is-free-model.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/kilo-exclusive-models.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/kilo-exclusive-models.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/models.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/routing.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/routing.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/apply-provider-specific-logic.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/get-provider.local-fake.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/kilo-exclusive-model.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/kilo-exclusive-model.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/openrouter/index.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/openrouter/index.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/stepfun.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/vercel/mapModelIdToVercel.test.ts - 0 issues
  • packages/web-shared/src/lib/ai-gateway/providers/vercel/mapModelIdToVercel.ts - 0 issues

Verification Notes

  • The one previously hidden entry (Gemma 4 26B free) remains hidden: it is on HARDCODED_UNAVAILABLE_MODEL_IDS (unavailable-models.ts:10), is filtered out of the catalog concat (openrouter/index.ts:170), and its direct requests are still rejected while kilo-auto skips the check (llm-proxy.ts:777).
  • The removed pool hidden_model reason is safe because buildEligibleCatalog resolves against getEnhancedOpenRouterModels()/getAvailableModelsForOrganization(), both of which derive from the same enhanced catalog that excludes unavailable ids, so unavailable models fall through to unknown_model.
  • The deleted stepfun/step-5-preview-free entry has no remaining references in the repository.

Reviewed by deepseek-v4.1-flash · Input: 92.6K · Output: 21.4K · Cached: 2.6M

Review guidance: REVIEW.md from base branch main

@joshburt
joshburt self-requested a review October 16, 2026 19:16
@chrarnoldus chrarnoldus changed the title refactor(gateway): drop Kilo-exclusive model status in favor of the unavailable list [AISAGE-707] refactor(gateway): drop Kilo-exclusive model status in favor of the unavailable list Oct 19, 2026
chrarnoldus and others added 2 commits October 19, 2026 13:06
…clusive-status

# Conflicts:
#	packages/web-shared/src/lib/ai-gateway/kilo-exclusive-models.test.ts
#	packages/web-shared/src/lib/ai-gateway/kilo-exclusive-models.ts
#	packages/web-shared/src/lib/ai-gateway/models.test.ts
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