Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): a slow but healthy Codex no longer shows as Unavailable #15945

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/15945/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Problem

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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 4b23461. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB4.9 KiB−23 B (−0.5%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB−23 B (−1.9%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.8 KiB−41 B (−0.2%)29.3 KiB✅
      CodexLive turn messages21−1 (−50.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: e3b35d1 · PR result: 4b23461 · Source CI: success

      Scenario 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.

    4. juliusmarminge added labelsmacroscope-review

    5. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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_commits setting.

      • Last reviewed commit: 4b234617ba84fdf491bdcda23ca4767ac55e2413

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to 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.ts
      • apps/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.ts
      The 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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely identifies the Codex timeout fix and its user-visible effect.
      Description checkPassedThe 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 checkPassedIssue #7513 requires the Codex probe to avoid false timeouts for healthy installations under slow or loaded conditions. CodexProvider.ts replaces the shared timeout with `CODEX_AUTH_PROBE_TIMEOUT_MS…
      Out of Scope Changes checkPassedThe 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 #7513 requires the Codex probe to avoid false timeouts for healthy installations under slow or loaded conditions. CodexProvider.ts replaces the shared timeout with CODEX_AUTH_PROBE_TIMEOUT_MS = 20_000 for the full probe. ProviderRegistry.test.ts verifies that a healthy 15-second probe returns ready and 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
      Comment `@coderabbitai help` to get the list of available commands.
    6. 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!

Sign in to join this conversation.