Summary
When a custom provider uses adapter: "anthropic" with a base URL that does not implement the Anthropic model-listing endpoint (e.g. Azure AI Foundry's Anthropic-compatible endpoint), the proxy log is flooded with this warning on every catalog poll:
[opencodex] Provider model discovery for "azure-foundry-anthropic" failed with HTTP 404 [urlClass=provider-models, fallback=configured].
The warning repeats dozens of times per session (the dashboard/Codex polls the catalog frequently, and each poll after the discovery cache/cooldown expires re-probes and re-logs), drowning out useful log output.
Environment
- opencodex
@bitkyc08/opencodex 0.144.5 (Windows 11, Node via scoop/nvm)
- Provider config:
Root cause
buildModelsRequest() (src/oauth/index.ts) probes GET {baseUrl}/v1/models?limit=1000 for every adapter: "anthropic" provider.
Azure AI Foundry's Anthropic endpoint only implements the inference route, not the models-list route. Verified directly against the endpoint:
GET /anthropic/v1/models → 404
POST /anthropic/v1/messages → 200
So discovery can never succeed for this provider class; the 404 → fallback=configured path in src/codex/catalog/provider-fetch.ts works correctly (the configured static models list is served and inference is unaffected), but the warning is re-emitted forever.
Workaround
Setting "liveModels": false on the provider skips discovery entirely and silences the log. This works, but users have to discover the flag after the fact.
Suggested fixes (any of these would help)
- Log once per provider per process (or once per cooldown window) instead of on every failed probe — e.g. demote repeats to debug level after the first warning.
- Remember a "discovery unsupported" verdict: after N consecutive 404s on
urlClass=provider-models, treat the provider as liveModels: false for the rest of the session (keep the configured/static list) and log a single informative line suggesting the config flag.
- Optionally, have the Azure Foundry preset/docs set
liveModels: false by default, since the endpoint is known not to implement /v1/models.
Happy to provide more logs if useful. Thanks for the project!
Summary
When a custom provider uses
adapter: "anthropic"with a base URL that does not implement the Anthropic model-listing endpoint (e.g. Azure AI Foundry's Anthropic-compatible endpoint), the proxy log is flooded with this warning on every catalog poll:The warning repeats dozens of times per session (the dashboard/Codex polls the catalog frequently, and each poll after the discovery cache/cooldown expires re-probes and re-logs), drowning out useful log output.
Environment
@bitkyc08/opencodex0.144.5 (Windows 11, Node via scoop/nvm)Root cause
buildModelsRequest()(src/oauth/index.ts) probesGET {baseUrl}/v1/models?limit=1000for everyadapter: "anthropic"provider.Azure AI Foundry's Anthropic endpoint only implements the inference route, not the models-list route. Verified directly against the endpoint:
GET /anthropic/v1/models→ 404POST /anthropic/v1/messages→ 200So discovery can never succeed for this provider class; the 404 →
fallback=configuredpath insrc/codex/catalog/provider-fetch.tsworks correctly (the configured staticmodelslist is served and inference is unaffected), but the warning is re-emitted forever.Workaround
Setting
"liveModels": falseon the provider skips discovery entirely and silences the log. This works, but users have to discover the flag after the fact.Suggested fixes (any of these would help)
urlClass=provider-models, treat the provider asliveModels: falsefor the rest of the session (keep the configured/static list) and log a single informative line suggesting the config flag.liveModels: falseby default, since the endpoint is known not to implement/v1/models.Happy to provide more logs if useful. Thanks for the project!