[Bug]: Codex provider flaps between Ready and "Timed out while checking Codex app-server provider status" on slow networks #20234
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
- Sign in to Codex with ChatGPT auth and enable it in Settings → Providers (default health check interval: 5 min).
- Use a network with slow or variable latency to OpenAI. For example a VPN, or 2–3 s of added latency on auth.openai.com / chatgpt.com (clumsy on Windows,
tc netemon Linux). - Leave the app open for a few health check cycles (or set the interval to 1 min).
- Watch the Codex provider status in Settings → Providers or the provider picker.
Expected behavior#
Codex stays Ready. A slow but successful check, or one slow optional step (skills or the model list), shouldn't mark the provider as unavailable. Codex threads still work the whole time.
Actual behavior#
The provider switches between Ready and Unavailable with "Timed out while checking Codex app-server provider status." from one check to the next. Real Codex turns keep working; only the health check fails.
Cause, from the shipped server bundle: checkCodexProviderStatus wraps all of probeCodexAppServerProvider in one timeoutOption(AUTH_PROBE_TIMEOUT_MS), where AUTH_PROBE_TIMEOUT_MS = 10_000. That one probe:
spawn codex app-server → initialize → account/read → in parallel: skills/list + model list + account/rateLimits/read
Only account/rateLimits/read has its own timeout (RATE_LIMITS_PROBE_TIMEOUT_MS = 3s) and a fallback. If account/read or the model list is slow, the whole probe runs past 10s and the snapshot becomes status "error" until the next check.
Measured on the affected machine (13 probes, VPN on):
- initialize: ~150 ms every time (startup and config are not the problem)
- account/read: 0.3–8.9 s
- full probe: usually 0.3–2 s, worst cases 6.9 s and 10.9 s
- TLS handshake to auth.openai.com: 1.2–5.1 s
Also: probeCodexSkillsForCwd already gets timeout("20 seconds"), so the bigger status probe having half that looks unintended.
Suggested fix:
- Apply the hard deadline only to initialize + account/read. Give skills/list and the model list their own timeouts with fallbacks (empty skills, the cached model catalog already merged in by applyCodexModelCatalog), like account/rateLimits/read has now.
- Optionally: if the previous check was Ready, a timeout keeps the last good snapshot and marks it stale/warning instead of error, or the status only flips after N failures in a row. Happy to open a PR for (1) if that direction works for you.
Impact#
Blocks work completely
Version or commit#
0.0.46-nightly.20261015.3176
Environment#
Windows 11 Pro 10.0.26300, T3 Code (Nightly) desktop 0.0.46-nightly.20261015.3176, codex-cli 0.163.0 (ChatGPT auth), VPN active
Logs or stack traces#
Codex app-server log during the timed-out probes:
failed to refresh available models: request timed out
chatgpt.com/backend-api/wham/usage sometimes returned 403 (Cloudflare HTML page) during probes.
Note: the timeout message isn't written to the T3 server trace (server.trace.ndjson) or server-child.log. It only appears in the provider snapshot, which makes this hard to diagnose from logs.
Screenshots, recordings, or supporting files#
No response
Workaround#
None for the status itself: the 10s timeout is hardcoded. Changing the health check interval only changes how often it flips. Starting a Codex thread works fine while the status says Unavailable. Exempting OpenAI domains from the VPN (split tunnelling) reduces the latency spread and makes the flapping rarer.
For now the only workaround is just waiting for the next check any praying it will pass... :(
Ouna-the-Dataweaver(GitHub profile, opens in a new tab) added labelsbug
Ouna-the-Dataweaver(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsbug
juliusmarminge removed labelsneeds-triage
juliusmarminge closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the measurements. This is fixed on main by #15945, which merged today (Oct 16) after your nightly (
0.0.46-nightly.20261015.3176) was built. Codex now gets its own 20sCODEX_AUTH_PROBE_TIMEOUT_MSbudget for the whole status probe instead of the shared 10s one, so your worst case of about 10.9s will pass. It's the same root cause as #7513, which that PR closed.Your second idea, keeping the last good snapshot when a check times out instead of flipping to an error, is tracked in #7230. If Codex still flaps on the next nightly, please reopen with fresh timings and we can look at giving each step its own timeout, the way you suggested.