Skip to content

fix(codex): allow slow provider probes to finish - #9303

Closed
Michel-Liao wants to merge 1 commit into
pingdotgg:mainfrom
Michel-Liao:fix/codex-probe-timeout
Closed

Michel-Liao wants to merge 1 commit into
pingdotgg:mainfrom
Michel-Liao:fix/codex-probe-timeout

Conversation

@Michel-Liao

@Michel-Liao Michel-Liao commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Codex provider health check performs a full app-server handshake plus account, model, and skill discovery under the shared 10-second auth-probe timeout. On Windows, healthy probes have been measured above that limit during startup, causing an installed and authenticated provider to appear broken until a later refresh.

Closes #7513.

Fix

Give the multi-step Codex probe a 20-second budget while leaving other provider probe timeouts unchanged. A focused virtual-clock regression test verifies that a 15-second healthy probe succeeds, and the existing timeout cleanup test now covers the new boundary.

Testing

  • node_modules/.bin/vp test run apps/server/src/provider/Layers/ProviderRegistry.test.ts (42 passed)
  • targeted lint and formatting checks

Model: GPT-5.6 Sol
Harness: Codex in T3 Code


Note

Low Risk
Scoped to Codex health-check timing and tests; no auth or data-path changes.

Overview
Raises the Codex provider status probe timeout from the shared 10s to a Codex-specific 20s, because the app-server handshake plus account, model, and skill discovery can exceed 10s on Windows without indicating a real failure.

Other providers keep using AUTH_PROBE_TIMEOUT_MS from providerSnapshot.ts. Tests add a case where a 15s healthy probe still reports ready, and the hanging-probe timeout test advances the clock 21s to match the new limit.

Reviewed by Cursor Bugbot for commit 176928e7abb8dbec299988a388adf41c8dd4c23f. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Codex provider detection by allowing longer startup checks to complete successfully.
    • Reduced false timeout results for Codex checks on slower systems or during concurrent startup activity.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 3, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This narrowly scoped change raises the default Codex provider-probe timeout from 10 to 20 seconds for all enabled users, altering existing product behavior even though it includes focused regression coverage. The default-policy change warrants explicit human review.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@shivamhwp

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

Please rebase the Codex timeout change onto current main. The import hunk conflicts with the newer custom-model and usage-limit work; keep readCustomModelEntries, COMPACT_SLASH_COMMAND, and the current rate-limit helpers while replacing only the auth-probe timeout.

@Michel-Liao
Michel-Liao force-pushed the fix/codex-probe-timeout branch from 176928e to 6931f69 Compare September 13, 2026 00:58
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (68c2277f5) and resolved the import conflict by retaining readCustomModelEntries, COMPACT_SLASH_COMMAND, and the current usage/rate-limit helpers. The behavioral diff still only gives the Codex auth probe its 20-second budget; other provider probe timeouts remain unchanged.

Verification on 6931f69cf:

  • ProviderRegistry.test.ts: 51 passed
  • server typecheck passed
  • changed-file lint, formatting, and git diff --check passed

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 66792e61-5ab2-4793-a837-e101942367d0

📥 Commits

Reviewing files that changed from the base of the PR and between 2db675a and 6931f69.

📒 Files selected for processing (2)
  • apps/server/src/provider/Layers/CodexProvider.ts
  • apps/server/src/provider/Layers/ProviderRegistry.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The Codex provider probe timeout increases from 10 to 20 seconds. Tests verify that a 15-second probe succeeds and that timeout cleanup remains covered.

Changes

Codex probe timeout

Layer / File(s) Summary
Codex timeout implementation
apps/server/src/provider/Layers/CodexProvider.ts
Adds a file-local 20-second timeout for the Codex app-server probe and uses it in checkCodexProviderStatus.
Probe timeout validation
apps/server/src/provider/Layers/ProviderRegistry.test.ts
Adds coverage for a 15-second successful probe and updates timeout cleanup timing to 21 seconds.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to 6931f

The change is limited to allowing slower Codex startup probes to complete; no unresolved merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: allowing slow Codex provider probes to complete.
Description check ✅ Passed The description explains the problem, the fix, scope, linked issue, and testing. It does not use the template headings exactly and omits the checklist, but it provides the required change rationale an…
Linked Issues check ✅ Passed Issue #7513 requires Codex probes to avoid premature timeout during slow Windows startup without changing other provider behavior. CodexProvider.ts removes the shared 10-second timeout use, adds `CO…
Out of Scope Changes check ✅ Passed The pull request changes only the Codex probe timeout and related regression tests. The changes directly support issue #7513 and do not modify unrelated provider behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

shivamhwp pushed a commit that referenced this pull request Oct 8, 2026
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 pushed a commit that referenced this pull request Oct 8, 2026
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 pushed a commit that referenced this pull request Oct 14, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in 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

3 participants