fix(model_switch): use live API discovery for openai-codex in gateway/Telegram picker#17320
fix(model_switch): use live API discovery for openai-codex in gateway/Telegram picker#17320DRuiCHEN wants to merge 1 commit into
Conversation
`list_authenticated_providers()` (used by the Telegram/gateway model
picker) was falling through to the static curated list for openai-codex,
while the CLI path called `provider_model_ids("openai-codex")` which
does a live OAuth-authenticated fetch via `get_codex_model_ids`.
This caused models available to the user's account (e.g. gpt-5.5) to
appear in the CLI picker but not in Telegram.
Fix: add "openai-codex" to the set of providers that call
`provider_model_ids()` for live discovery, consistent with how copilot
and copilot-acp are already handled. The underlying `provider_model_ids`
implementation already falls back to the hardcoded catalog if no token
is available or the endpoint is unreachable.
|
Likely duplicate of #7211 — same fix: wire openai-codex into live model discovery for the gateway/Telegram picker. |
|
To clarify the duplicate concern: our change is correct and intentional.
Regarding #7211: it takes a broader approach (new abstraction layer, 128 lines, new test file) which is a reasonable long-term refactor. However, it has been open for 19 days without forward progress. This fix is self-contained and risk-free — the fallback behavior means no regression if the live endpoint is unreachable. Happy to close in favour of #7211 if that PR is actively moving toward merge, but if it is stalled, merging this one-liner now would unblock users immediately. |
|
Closing as already fixed on Triage notes (high confidence): If you still see this on the latest version, please reopen with reproduction steps. (Bulk-closed during a CLI triage sweep.) |
Problem
Models available to a user's OpenAI Codex account (e.g.
gpt-5.5) appear in the CLI model picker but not in the Telegram/gateway picker.Root Cause
list_authenticated_providers()— used by the gateway/Telegram model picker — falls through to the static curated list foropenai-codex:The CLI path calls
provider_model_ids("openai-codex")which performs a live OAuth-authenticated fetch viaget_codex_model_ids(access_token=...), so new models appear there immediately. The gateway never makes that call.The comment in
models.pyline ~1903 even states the intention:…but this was only wired up for the CLI path.
Fix
Add
"openai-codex"to the set of providers that useprovider_model_ids()for live discovery — consistent with howcopilotandcopilot-acpare already handled:provider_model_ids("openai-codex")already falls back to the hardcoded catalog if no token is available or the endpoint is unreachable, so this is safe.Testing
gpt-5.5: confirm the model appears in the Telegram picker after this change