fix(codex): a slow but healthy Codex no longer shows as Unavailable #15945
main fromrefs/pull/15945/head·merged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubProblem#
On a slow machine, the Codex card in Settings > Providers flips to "Unavailable · Timed out while checking Codex app-server provider status" even though Codex is installed, signed in, and working. It stays that way until the next 5-minute refresh. #7513 measured this on Windows in about 1 of 4 probes: the Codex check finished in 10.07s, just past T3's 10s cutoff.
The Codex check does more than a version or auth call. It starts codex app-server, initializes it, and reads the account, models, and skills, all inside the 10s budget every provider shares.
Change#
Codex gets its own 20s budget (CODEX_AUTH_PROBE_TIMEOUT_MS) instead of the shared AUTH_PROBE_TIMEOUT_MS. Grok, the only other user of the shared constant, keeps 10s. Nothing wraps checkCodexProviderStatus in a shorter timeout, so the new budget applies end to end.
This rebuilds #9303 by @Michel-Liao on current main. That PR was closed when orchestration V2 replaced the code around it.
Scope and approval#
A small fix for an obvious bug: one timeout constant, scoped to the one provider whose check needs it. No behavior changes for working fast machines. Closes #7513.
Verification#
Reproduced in the real web app with a wrapper around the real Codex binary that waits 12s before starting (sleep 12; exec codex "$@"), set as the binary path of a Codex instance. The video starts with Refresh provider status and counts the seconds.
Before (main 1e2ecbd): after about 10s the card turns to Unavailable, "Timed out while checking Codex app-server provider status".
https://github.com/user-attachments/assets/efc63a56-de54-4782-8871-adbaaace3b3f
After (this PR): the card takes about 14s and lands on Available, v0.160.0.
https://github.com/user-attachments/assets/6dfd8cd4-173c-4011-8e2e-e8861dcdf772
Focused test: vp test run apps/server/src/provider/ProviderRegistry.test.ts
- New test "does not time out a healthy probe slower than the shared 10s auth-probe timeout (#7513)" uses a probe that answers after 15s.
- Without the fix it fails:
expected 'error' to equal 'ready'(1 failed, 56 passed). - With the fix: 57 passed (58 after rebasing onto current main). The existing timeout test now advances the clock 21s instead of 11s so it still covers a real timeout.
Not checked: Windows itself. The wrapper adds a fixed delay instead.
Made with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 4.9 KiB −23 B (−0.5%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −23 B (−1.9%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.8 KiB −41 B (−0.2%) 29.3 KiB ✅ Codex Live turn messages 2 1 −1 (−50.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
e3b35d1· PR result:4b23461· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
juliusmarminge added labelsmacroscope-review
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: 4b234617ba84fdf491bdcda23ca4767ac55e2413
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
026b0458-b133-41af-8281-a25ea6fcef67
📥 Commits
-
Reviewing files that changed from the base of the PR and between 4ba0f5101c3d444e4a9c091d9ac60f462e113cb3 and 4b234617ba84fdf491bdcda23ca4767ac55e2413.
📒 Files selected for processing: 2
-
apps/server/src/provider/CodexProvider.tsapps/server/src/provider/ProviderRegistry.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The Codex provider status probe now uses a dedicated 20-second timeout instead of the shared timeout. Tests cover a healthy probe lasting 15 seconds and a probe that exceeds the timeout.
Changes: Codex probe timeout
Layer / File(s) Summary Codex status probe timeout
apps/server/src/provider/CodexProvider.ts,apps/server/src/provider/ProviderRegistry.test.tsThe Codex status check uses a 20-second timeout. Tests verify that a healthy 15-second probe returns ready and that a probe exceeding 20 seconds returns an error and terminates its process. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
4b234-
Codex status checks now have more time to complete before being marked unavailable, while probes exceeding the limit still return an error. No concrete merge-blocking issue is established; the change is ready to merge.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely identifies the Codex timeout fix and its user-visible effect. Description check The description covers the problem, change, scope, approval rationale, verification results, limitations, and agent attribution. It provides focused test details and before/after evidence. Linked Issues check Issue #7513requires the Codex probe to avoid false timeouts for healthy installations under slow or loaded conditions.CodexProvider.tsreplaces the shared timeout with `CODEX_AUTH_PROBE_TIMEOUT_MS…Out of Scope Changes check The diff changes only the Codex probe timeout and focused provider-status tests. The production change directly addresses #7513. The tests verify the new success boundary and existing timeout behavior…Full details: Linked Issues check
-
Explanation
Issue
#7513requires the Codex probe to avoid false timeouts for healthy installations under slow or loaded conditions.CodexProvider.tsreplaces the shared timeout withCODEX_AUTH_PROBE_TIMEOUT_MS = 20_000for the full probe.ProviderRegistry.test.tsverifies that a healthy 15-second probe returnsreadyand preserves timeout coverage at 21 seconds. The issue's timeout-extension option is implemented.
Full details: Out of Scope Changes check
-
Explanation
The diff changes only the Codex probe timeout and focused provider-status tests. The production change directly addresses
#7513. The tests verify the new success boundary and existing timeout behavior. No unrelated change is present.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
One concern: on Windows<-->WSL, the Codex provider probe time can increase significantly with the number of skills stored on the Windows drive. This means even a 20-second timeout may not be sufficient. I'd suggest increasing it to 60 seconds, or ideally making it configurable.
That said, this fix is urgently needed, and I wouldn't want the timeout discussion to delay merging it. We can address the remaining edge cases in a follow-up.
@juliusmarminge @t3dotgg Could you please take a look at this PR? The fix is urgently needed for Windows/WSL users, and all checks are passing. Would appreciate getting this merged soon!
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — The PR doubles the hard-coded Codex provider-status timeout from 10 seconds to 20 seconds, changing when a production provider is marked unavailable. The added regression test covers the slower healthy path, while the test-only changes have no runtime impact.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).4b23461. Prior analysis still applies.