Commit Graph

1 Commits

Author SHA1 Message Date
Victor Kyriazakos 173a73e191 fix(models): honor model.base_url in OpenAI discovery, cache identity, and listing authority
Three catalog-side defects from the same report, all downstream of the
exact-host assumption and the config/env asymmetry:

- Discovery read only $OPENAI_BASE_URL, so a config-set
  model.base_url (the supported way to select a data-residency host)
  was ignored and /model listed the catalog of api.openai.com, not the
  configured endpoint. New _openai_discovery_base_url() resolves
  env override -> matching model.base_url -> canonical default, the same
  precedence inference uses.

- _credential_fingerprint() hashed env vars only, so hermes config set
  model.base_url kept serving the previous endpoint's cached catalog
  until TTL expiry. The effective endpoint is now folded into the
  fingerprint for openai/openai-api.

- is_default_openai matched two literal URLs, so regional hosts (which
  serve the identical 120+ entry dump) bypassed the curated intersection
  and flooded the picker with whisper/tts/embedding/dall-e rows. Now uses
  the shared official-host predicate; custom OpenAI-compatible proxies
  keep the verbatim live list.

- validate_requested_model's curated-catalog soft-accept (#46850) no
  longer applies on official OpenAI hosts: their /v1/models listing is
  access-scoped and authoritative, so accepting an absent model
  manufactures a selection that 400s at first use. Custom proxies and
  other providers keep the #46850 fallback. The #37404
  empty-intersection -> curated picker fallback is deliberately left
  unchanged.
2026-07-31 21:31:56 -07:00