Skip to content

fix: accept custom models the web picker already offers - #980

Open
siddiqueirshad wants to merge 1 commit into
yc-software:mainfrom
siddiqueirshad:fix/web-turn-custom-model-allowlist
Open

fix: accept custom models the web picker already offers#980
siddiqueirshad wants to merge 1 commit into
yc-software:mainfrom
siddiqueirshad:fix/web-turn-custom-model-allowlist

Conversation

@siddiqueirshad

@siddiqueirshad siddiqueirshad commented Sep 8, 2026

Copy link
Copy Markdown

Why

With no web-UI allowlist and no OpenRouter key, GET /v1/surface-config still lists admin-registered custom models (from builtInModelCatalog()). Sending a turn on one of those models was refused: validateWebTurnModelOptions fell back to DEFAULT_WEBUI_MODEL_IDS, which never includes custom ids. postTurn maps that refusal to HTTP 403.

That is the documented custom-provider path. The picker and the gate disagreed.

Fixes #952

What

  • Default web-UI model ids now include the live custom catalog, matching overlays.
  • When no allowlist is configured, web-turn validation uses the same catalog as the picker (builtInModelCatalog, or the OpenRouter catalog when that key is present) instead of leaving the allowlist null.
  • An explicit Governance allowlist still refuses custom models that are not on it.

Tests

  • Unit: fallback allowlist includes a registered custom model; an explicit allowlist still refuses it.
  • Integration: register a custom provider with no OpenRouter/OpenAI env key, confirm the picker lists it, a web turn queues, then an allowlist that omits it refuses with that model is not enabled for the web UI.
  • Focused suites: test/turn-options.test.ts, test/custom-providers.test.ts, test/custom-provider-route.test.ts, test/model-registry.test.ts — 33 passed.

Made with Cursor


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Web turns with no org allowlist and no OpenRouter key fell back to the
built-in DEFAULT_WEBUI_MODEL_IDS set, so admin-registered custom models
that the picker listed were refused as HTTP 403.

Fixes yc-software#952

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Web turn validation falls back to DEFAULT_WEBUI_MODEL_IDS and refuses custom models the picker offers (surfaces as bare HTTP 403)

1 participant