Skip to content

Providers: a live catalog that falls back to the shipped models says nothing (no catalogError) #5504

Open

Description

@yannickmonney

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)

  • getProviderCatalog for an openrouter-api provider goes through cachedLiveCatalog (services/platform/backend/core/lib/providers/catalog_fetch.ts). When the fetch fails and the call is not a forced refresh, it returns serveDegraded(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) sets catalogError/catalogErrorCode only when getProviderCatalog throws, so the degraded entry comes back as a normal one.
  • The UI shows a catalog problem only through catalogError (credential-adapter.tsx detailLine → 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 catalogError for this state. useModelCatalog (governance/hooks/model-catalog.ts:101) turns offered into null when any configured provider has a catalogError, so a degraded-but-serving entry would switch off model enforcement in governance. The org embedding section also treats catalogError as "no list".
  • PROV-R6 still holds: a degraded provider changes no other provider's list.
  • Every new string in en, de and fr.

Proposal

  1. getProviderCatalog (or a sibling the /catalogs route calls) reports how it was served: live, cached (a previous fetch's list, older than the TTL after a failed refresh) or shipped-defaults, plus the failure code and message when it is degraded. cachedLiveCatalog already knows which branch of serveDegraded it took. The other 14 callers keep the plain array.
  2. GET /catalogs adds catalogDegraded?: { servedFrom: 'cached' | 'shipped-defaults'; error: string; errorCode?: ProviderCatalogFailureCode }, a field separate from catalogError. The contract in app/lib/backend/contract/lib.ts gets the same field.
  3. 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. catalogFailureText already turns the code into readable text.
  4. 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-defaults on 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 only shipped-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions