Repository navigation
Description
Summary
When OpenRouter's live model list cannot be fetched and nothing is cached yet, the providers settings page and every model picker show the 24 models Tale ships for OpenRouter, and nothing says the list is a fallback. The entry carries no catalogError, so the page reads exactly like a healthy OpenRouter that offers only 24 models. A person then looks for the cause in the wrong place.
services/platform/backend/domains/providers/spec.md (## Not yet) already records this as undecided: "should a provider whose live list cannot be fetched say it shows a fallback?" This issue asks for that decision and the change.
What main does today (at ee8cb1cd4f)
getProviderCatalogfor anopenrouter-apiprovider goes throughcachedLiveCatalog(services/platform/backend/core/lib/providers/catalog_fetch.ts). When the fetch fails and the call is not a forced refresh, it returnsserveDegraded(cached, defaults, err)(:614,:674). With no cached catalog,serveDegraded(:710) returns the shipped defaults (configs/platform/system/models/openrouter/models.yml, 24 entries) and does not throw. The comment says this is deliberate: "Silent — the failure was logged when it was remembered".- The only sign is a server log line from
warnRememberedFailure(:680):[catalog] openrouter: fetch failed with nothing cached; serving the shipped defaults (24 models) for the next 300s. GET /catalogs(services/platform/backend/domains/providers/routes.ts:384) setscatalogError/catalogErrorCodeonly whengetProviderCatalogthrows, so the degraded entry comes back as a normal one.- The UI shows a catalog problem only through
catalogError(credential-adapter.tsxdetailLine→providers.card.catalogUnavailable). A forced refresh (POST /catalogs/refresh) does surface the failure (catalog_fetch.ts:664), but nothing tells a person to press it.
How it misled (Tale preview, 2026-11-23)
The preview backend's outbound DNS was fenced, so OpenRouter's listing could not be reached. The OpenRouter entry then listed 24 models and showed no error. The narrow list looked like a scoping defect: it seemed that adding an organization's own provider (a Bifrost gateway whose ids look like OpenRouter's provider/model ids) had narrowed OpenRouter's list. Proving otherwise took two investigation lanes, a scoping regression test (#5492, spec PROV-R6) and a create-dialog UI test. The real cause, the DNS fence, was only in the server log.
Constraints
- Keep serving the fallback. Chat, governance and embedding must keep working while OpenRouter is unreachable, and the decision to serve shipped defaults stays.
- Do not reuse
catalogErrorfor this state.useModelCatalog(governance/hooks/model-catalog.ts:101) turnsofferedintonullwhen any configured provider has acatalogError, so a degraded-but-serving entry would switch off model enforcement in governance. The org embedding section also treatscatalogErroras "no list". - PROV-R6 still holds: a degraded provider changes no other provider's list.
- Every new string in en, de and fr.
Proposal
getProviderCatalog(or a sibling the/catalogsroute calls) reports how it was served:live,cached(a previous fetch's list, older than the TTL after a failed refresh) orshipped-defaults, plus the failure code and message when it is degraded.cachedLiveCatalogalready knows which branch ofserveDegradedit took. The other 14 callers keep the plain array.GET /catalogsaddscatalogDegraded?: { servedFrom: 'cached' | 'shipped-defaults'; error: string; errorCode?: ProviderCatalogFailureCode }, a field separate fromcatalogError. The contract inapp/lib/backend/contract/lib.tsgets the same field.- The provider card and the credential rows show a warning-tone line, for example: "Showing Tale's built-in list of 24 models: OpenRouter's live list could not be loaded ({error}). Refresh to try again." (en/de/fr). It links to the existing refresh action.
catalogFailureTextalready turns the code into readable text. - Spec: move the undecided item into a PROV rule, e.g. "A provider whose live list cannot be fetched keeps serving its last or shipped list and says so on its own entry". Tests: a backend test that the route reports
shipped-defaultson a fenced fetch with an empty cache, and a UI test for the warning line.
Questions
- Should a
cached(stale) list also be marked, or onlyshipped-defaults? A stale list is complete but old. Shipped defaults are a different, much shorter list. - Should the model pickers (chat composer, agent settings) show the degraded state too, or only the providers settings page?
Activity