Repository navigation
Description
What happened
A newly released Codex model (gpt-6.2-sol) did not show up in T3's model catalog or in orchestrator_capabilities for an agent that asked for it. The agent concluded the model did not exist and delegated on gpt-6.1-sol instead. Nothing told the user or the agent that the catalog was stale. The model appeared about ten minutes later, only after some other Codex process happened to write a fresh models_cache.json.
Diagnosis
requestCodexChatGptModels calls model/list, then polls $CODEX_HOME/models_cache.json until fetched_at >= spawnedAtMs, bounded by CODEX_CATALOG_REFRESH_TIMEOUT_MS = 3e3 and the probe deadline. On timeout it logs Codex did not refresh its model catalog in time; using the cached catalog. (WARN), returns the old list, and the probe's app-server is stopped.
Codex's own refresh is often slower than that. In Codex's log (~/.codex/logs_2.sqlite), GET https://chatgpt.com/backend-api/codex/models returns 200 OK, and about 10 ms later codex_models_manager logs failed to refresh available models: request timed out. The response is about 600 KB. So Codex sometimes never writes the cache, and T3 has already given up by then either way.
Timeline (UTC, 2026-11-18, T3 server trace + Codex log):
- 13:13:15
requestCodexChatGptModelstakes 8014 ms and falls back to the cache (WARN). - 13:17:30–41 the agent searches the catalog for "gpt-6.2 sol", "sol" and "6.2". Only
gpt-6.1-sol,gpt-6-solandgpt-5.6-solcome back. - 13:18:28 the refresh takes 3009 ms and falls back again (WARN).
- 13:20:15, 13:23:36 Codex:
GET /models200, then "request timed out". - 13:26:46 a fresh
models_cache.jsonis finally written (gpt-6.2-sol,gpt-6.2-astrapresent). - 13:28:10
ProviderRegistry.refreshModelCatalogsucceeds in 584 ms, and the model appears.
Over one day of traces, 4 of 17 requestCodexChatGptModels calls hit the fallback.
Expected
- When the refresh times out, keep a background refresh going (or retry with backoff) and publish the catalog when a fresh cache lands, rather than waiting for the next probe.
- Surface staleness: when the catalog comes from a cache older than the probe, say so (for example
catalogFetchedAtor astaleflag inorchestrator_capabilitiesand provider status), so agents don't read "missing" as "does not exist". - Optionally, let
delegate_taskaccept a model id that is inmodels_cache.jsonbut not yet in the published catalog.
Version
T3 Code 0.1.10 (macOS arm64, local server), codex-cli 0.169.0, ChatGPT sign-in.
Related but different root cause: #33701 (catalog 401 after the managed token expires). Here the catalog request is authorized (200), but the body download times out.
Activity
Dopetaiga commentedon Nov 19, 2026
I'd like to work on this. Confirmed on main:
requestCodexChatGptModelspollsmodels_cache.jsonforCODEX_CATALOG_REFRESH_TIMEOUT_MS(3s) and silently serves the stale catalog when Codex's own refresh misses, so a new model can be invisible to the agent for minutes. Plan: reproduce with a probe, then surface the staleness to the caller and retry the refresh instead of a single 3s wait; PR to follow per the repo's rules.