Skip to content

test(platform): lock each provider's model list to its own catalog - #5492

Merged
yannickmonney merged 2 commits into
mainfrom
test/openrouter-models-not-narrowed-by-custom-provider
Nov 23, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
test/openrouter-models-not-narrowed-by-custom-provider

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Problem (as seen on preview, v0.5.107)

After an OpenAI-compatible custom provider was added, the OpenRouter model dropdown looked narrowed to a short list, as if the custom provider had restricted it.

Root cause

No code path scopes a provider's model list by another provider:

  • The live catalog cache, its remembered failures and its in-flight fetches are all keyed by provider name plus listing URLs.
  • GET /providers/catalogs fetches each provider with its own credential and its own try/catch.
  • A custom provider named like a shipped provider is refused at load, so lookups by name cannot collide.
  • Each settings dropdown reads only its own provider's catalog.

The likely cause is the preview backend's DNS fence. It makes every external name fail to resolve, openrouter.ai included. With nothing cached, OpenRouter silently serves its 24 shipped default models and shows no error on its entry. The custom provider is the only one that shows PROVIDER_CATALOG_UNREACHABLE. Together these looked like narrowing. The DNS fence is fixed in a separate change. This was not observed on preview directly.

Change

No production code changes.

  • Rule: the rule is stated as PROV-R5 in services/platform/backend/domains/providers/spec.md: each provider lists only its own models, and an organization's own provider shows its listing failure on its own entry.
  • Open question: the silent fallback to the shipped defaults is recorded under Undecided. Whether OpenRouter's entry should say it is showing the built-in list is a product decision.
  • Backend test catalogs-scope.test.ts: runs the catalog listing over the real fetch and cache, with OpenRouter next to a custom provider, both when it is reachable and when its host does not resolve.
  • UI tests in providers-settings.test.tsx: the add and edit dialogs each show only their own provider's models.

Tests

  • vitest --project server on backend/domains/providers/ plus tests/guards/domain-specs.guard.test.ts: 4 files, 40 tests pass, including the new catalogs-scope.test.ts with 2 tests.
  • vitest --config vitest.ui.config.ts providers-settings.test.tsx: 57/57 pass.
  • oxlint --type-aware exits 0 and oxfmt --check is clean on the changed files.

Follow-up

Once the DNS fence fix is deployed on preview, OpenRouter should list its full live catalog. Before that fix, the backend log shows [catalog] openrouter: fetch failed with nothing cached; serving the shipped defaults (24 models).

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #5497 merged. #5497 added its own PROV-R5 ("A listing with a key that is not saved goes to its asker alone") under a new "Listing a provider's models" section, so this PR's rule is now PROV-R6 in the same section; the two test tags and both commit messages follow. No other change: the rest of the patch is identical (range-diff).

@yannickmonney
yannickmonney force-pushed the test/openrouter-models-not-narrowed-by-custom-provider branch from 52a7e90 to 6977141 Compare November 23, 2026 15:36
An operator on preview v0.5.107 read OpenRouter's model dropdown as
narrowed to a custom OpenAI-compatible provider they had just added.
No code path scopes a catalog by anything but its provider: the live
catalog cache keys on provider name and listing URLs, the catalog
listing fetches per provider, and every dropdown reads its own
provider's entry. The likelier cause is the fenced backend DNS of
that deployment, where every live listing failed: OpenRouter served
its 24 shipped flagships with no error, and the custom provider
reported its DNS failure.

Hold the rule as PROV-R6: the catalog listing over the real fetch with
OpenRouter beside a custom provider, reachable and unresolvable, and
the settings dropdowns over both. Record the silent fallback as an
open question in the providers spec.
OpenRouter, like any live source with shipped defaults, falls back to
those defaults without an error on its entry, so only an organization's
own provider shows the failure. Drop a duplicate assertion in the
catalog scope test.
@yannickmonney
yannickmonney force-pushed the test/openrouter-models-not-narrowed-by-custom-provider branch from 6977141 to 48de448 Compare November 23, 2026 16:40
@yannickmonney
yannickmonney enabled auto-merge (squash) November 23, 2026 16:40
@yannickmonney
yannickmonney merged commit ca04a4d into main Nov 23, 2026
84 checks passed
@yannickmonney
yannickmonney deleted the test/openrouter-models-not-narrowed-by-custom-provider branch November 23, 2026 17:14
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.

1 participant