Skip to content

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

Open
shivamhwp wants to merge 1 commit into
mainfrom
fix/codex-slow-probe
Open

shivamhwp wants to merge 1 commit into
mainfrom
fix/codex-slow-probe

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

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

9303-before.mp4

After (this PR): the card takes about 14s and lands on Available, v0.160.0.

9303-after.mp4

Focused test: vp test run apps/server/src/provider/ProviderRegistry.test.ts

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 5, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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 9466c36. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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 5.0 KiB 0 B (0.0%) 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 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 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 +24 B (+2.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅
Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅

Baseline: a4c9494 · PR result: 9466c36 · 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.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 5, 2026
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f423f7e5-2177-4775-a128-fff609ece906
📥 Commits

Reviewing files that changed from the base of the PR and between ccb5cc4 and 9466c36.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 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: 91faf920-e0c3-4377-853d-5212c6a14220
📥 Commits

Reviewing files that changed from the base of the PR and between 144f6c8 and ccb5cc4.

📒 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; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Codex provider status probe now has a 20-second timeout instead of the shared 10-second timeout. Tests cover a healthy probe that takes 15 seconds and a probe that exceeds the new 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 21-second probe returns a timeout error. The timeout test also checks that the app-server process is killed once.

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 ccb5c

Healthy Codex probes that take between 10 and 20 seconds can now complete instead of showing an error; slower probes still time out. No concrete merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #7513 requires the Codex probe to avoid reporting a healthy provider as timed out under normal slow or loaded conditions. The change gives checkCodexProviderStatus a dedicated 20-second timeou…
Out of Scope Changes check ✅ Passed The supplied change summary contains only the Codex timeout change and focused tests for issue #7513. The test updates verify the new timeout and preserve timeout cleanup coverage. No unrelated change…
Title check ✅ Passed The title clearly and concisely describes the main change: preventing slow but healthy Codex providers from being marked unavailable.
Description check ✅ Passed The description covers the problem, change, scope, approval rationale, and focused verification. It includes reproduction details, test results, video evidence, and the limitation that Windows was not…
✨ 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.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 5, 2026
@shivamhwp
shivamhwp force-pushed the fix/codex-slow-probe branch from 144f6c8 to ccb5cc4 Compare October 8, 2026 00:53
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 8, 2026 00:53

Dismissing prior approval to re-evaluate ccb5cc4

A slow but healthy Codex app-server probe (handshake, account, models,
skills) can run past the shared 10s AUTH_PROBE_TIMEOUT_MS on a loaded
or slow machine, most often reported on Windows. When that happens,
Settings marks a working Codex provider as unavailable with "Timed
out while checking" until the next 5-minute refresh, even though
Codex is installed, logged in, and working.

Give Codex its own 20s probe timeout (CODEX_AUTH_PROBE_TIMEOUT_MS)
instead of raising the shared constant for every provider. Adds a
regression test for a 15s-healthy probe, and bumps the existing
probe-scope-closes-on-timeout test from 11s to 21s to match the new
budget.

Fixes #7513. Reuses the fix from Michel-Liao's closed PR #9303,
rewritten against the orchestration-v2 provider code.

Co-authored-by: Michel-Liao <107891771+Michel-Liao@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shivamhwp
shivamhwp force-pushed the fix/codex-slow-probe branch from ccb5cc4 to 9466c36 Compare October 8, 2026 10:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows: Codex provider probe exceeds the 10 s AUTH_PROBE_TIMEOUT on ~1 in 4 runs and flips the card to error until the next refresh

2 participants