Repository navigation
ci: retry codex-node-checks vitest step once on forks-worker startup timeout - #626
Conversation
…timeout Vitest 4.1.x hardcodes the forks-pool worker startup budget (90s ready / 60s handshake; raised from 5s/10s in vitest-dev/vitest#9027 but never made configurable). The suite forks a fresh worker per test file, so a load spike on the shared vps-verify runner can intermittently kill the Test step with "[vitest-pool]: Timeout starting forks runner." — a transient infra failure, not a verdict on the code. ci-vitest-run.sh retries the suite exactly once, and only when the failure matches that exact pool startup-timeout signature. Assertion errors, build errors and worker crashes still fail the step immediately with their original exit code, so the retry cannot mask a real regression. The retry runs inside the deploy-window lane the step already acquired, so it never re-enters the verification queue.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_07352298-d1ba-4552-a390-dcacc26bd33c) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ba407d310
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| exit "$rc" | ||
| fi | ||
|
|
||
| if ! is_worker_startup_timeout; then |
There was a problem hiding this comment.
Refuse retries when the run also contains test failures
When the codex-node-checks Vitest run reports an assertion failure from one file and later encounters a forks-worker startup timeout, this predicate treats the timeout’s mere presence as the sole cause of the nonzero exit. If the assertion is flaky or state-dependent and passes during the full-suite retry, the wrapper exits successfully and the required check becomes green despite the real first-attempt failure. Detect reported test failures separately, or otherwise verify that the startup timeout was the only failure before retrying.
Useful? React with 👍 / 👎.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f608beda-0e6b-43b5-bda7-5a73213ddf59) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cc71d3c4-c7d3-4e64-aa6a-7786b7724481) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_85a14805-b798-4ef0-a4d6-b2d4b05683b4) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_44b72bb4-67ce-4c90-9a31-e9deeb7d6462) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_723bbaea-0ebc-4134-91d0-b4cf0912d08d) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3add19f6-8c5a-474a-8a8e-230797417449) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_525743b8-658d-4050-8fa4-033ab0245dad) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_86e5c729-f54c-49a5-8c9b-eb42e22aba73) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3b06de09-ad53-4fe7-a2e1-5912b23f30d8) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78e145e832
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # [vitest-pool-runner]: Timeout waiting for worker to respond (60s handshake) | ||
| # [vitest-pool]: Failed to start forks worker ... (wrapper of the above) | ||
| is_worker_startup_timeout() { | ||
| grep -Eq -- '\[vitest-pool(-runner)?\]: (Timeout starting forks runner|Timeout waiting for worker to respond|Failed to start forks worker)' "$LOG_FILE" |
There was a problem hiding this comment.
Require a timeout cause before matching the startup wrapper
When a forks worker fails during bootstrap for a non-timeout reason, Vitest can still emit the generic [vitest-pool]: Failed to start forks worker wrapper; matching that line alone therefore retries failures such as an early child exit or initialization error. If the second full-suite run happens to pass, this makes the required check green despite the first run exposing a real worker-startup defect. Only accept this wrapper when its associated cause contains one of the explicit timeout messages.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f24eb41b-63ad-426e-adaa-973a499fb591) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b874e3ea-6978-4b56-800d-1e79824d1244) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b6e6d2d1-65d6-4358-9025-9c388a23afe4) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_6fce2d1a-f06a-4757-b230-624154946830) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3232f671-6987-49eb-8f5e-98a9beac810c) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_4d30bd84-546c-4570-beb2-9c364f2ad3cd) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f47fe209-e206-4282-8899-20d9ed7ead4f) |
…ml stable The codex-node-checks Test step was unstable for ~173h because Vitest 4.1.x hardcodes the forks-pool worker startup budget (90s ready / 60s handshake; raised from 5s/10s upstream but never configurable) and a load spike on the shared vps-verify runner can intermittently kill the whole suite with "[vitest-pool]: Timeout starting forks runner.". Move the single, signature-gated retry from the protected .github/workflows/ ci.yml Test step into the repo's own package.json "test" script (via scripts/ci-vitest-run.sh), so codex-node-checks, the deploy-production verification step and launch:readiness all get the same retry without changing any workflow file. The wrapper retries exactly once, and only on that exact startup-timeout signature; assertion errors, build errors and worker crashes still fail immediately with their original exit code. Also harden the verification lane to reuse one long-lived fork worker (vite.config.ts isolate: false) so the suite performs a single worker startup instead of one per file, removing the per-file startup failure at its root; the retry remains as the residual safety net. This keeps .github/workflows/ci.yml identical to main, so the PR no longer changes any protected verifier definition and the required-verifier-integrity gate passes without needing a manual approval. Co-authored-by: Nish
… the startup-timeout deflake The prior head wired `isolate: !isVerificationLane` into vite.config.ts to reuse one long-lived fork worker and remove per-file worker startups. Under `isolate: false` vitest shares one module registry across all files, which breaks `vi.mock` interception for modules already cached by an earlier file: `tests/plan-proof-usage-failure.test.ts` stopped mocking evidence-usage.server and failed with the real "D1 legacy top-up migration read failed" path. That turned the codex-node-checks check red on a genuine regression, not the transient startup timeout the PR targets. Drop the isolation toggle so vite.config.ts stays identical to main. The forks-worker startup-timeout flake is handled by the existing signature-gated retry in scripts/ci-vitest-run.sh (wired into package.json "test"), which retries exactly once and only on the pool startup-timeout signature. - vite.config.ts: revert to main (per-file isolation preserved). - scripts/ci-vitest-run.sh: refresh comment; it is now the deflake mechanism. - tests/vitest-runner-budget.test.ts: regression-guard that the verification lane config never disables isolation, and that the retry is signature-gated. - tests/deploy-window-lock.test.ts: assert the Test step command actually present in ci.yml (`npm run test`, which routes through the wrapper). Merged origin/main so .github/workflows/ci.yml leaves the PR diff (identical to main) and required-verifier-integrity no longer sees a protected change.
…d-verifier-integrity gate (#795) `gh api --paginate --jq '[.[] | …]'` applies --jq per page and concatenates the per-page results, so any PR with >100 files/reviews/issue-comments yields N back-to-back arrays — invalid input to the final `jq -n --argjson` that builds the context bundle ('invalid JSON text passed to --argjson', exit 2). PR #626 hit this with 104 issue comments, failing the gate before it could evaluate (it changes no protected files and would otherwise PASS). Emit one object per line (`--jq '.[] | …'`) and slurp the whole stream into one array (`jq -s .`) for every paginated fetch (files, reviews, comments). Adds tests/required-verifier-context-pagination.test.ts as a regression for the class: a structural guard on the workflow plus a functional check that two concatenated pages collapse into one valid array.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_69705e7b-135e-4a9a-ad84-b1d151a7580f) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_06d9d447-dc4d-4f3b-a471-a89b76898aad) |
…nt a canary (#626) The standing rule was queued because freeze-on-conflict was prose and the 2026-08-23 wipe could delete the timer with nobody screaming. Adopt the live handler into fleet-ops, drill the four safe classes plus quarantine, and make heartbeat block 11 fail if the timer dies or a fixture *.sync-conflict-* file is not cleared. Co-authored-by: Nishfleet Agent <[email protected]>
What
De-flakes
codex-node-checkson the vps-verify runner. The intermittent failure was the vitest forks-worker startup timeout killing theTeststep:Root cause (verified against installed vitest 4.1.10 source): vitest 4 hardcodes the forks-pool worker startup budget — 90s for the worker to report ready (
WORKER_START_TIMEOUT) and 60s for its start handshake (START_TIMEOUT), raised from 5s/10s in upstream vitest-dev/vitest#9027 (fixing #8968) but never made configurable. The suite forks a fresh worker per test file (isolate=true, and the verification lane pinsmaxWorkers: 1), so a load spike on the shared runner can push a single one of the ~394 sequential worker starts past the hardcoded budget and kill the whole step — a transient infra failure, not a verdict on the code.Change
scripts/ci-vitest-run.sh(new): runsnpm run test; retries exactly once, and only when the failure output matches the vitest pool startup-timeout signature ([vitest-pool]: Timeout starting forks runner./[vitest-pool-runner]: Timeout waiting for worker to respond/[vitest-pool]: Failed to start forks worker …). Any other failure — assertion errors, build errors, worker crashes — exits immediately with the original exit code, so the retry cannot mask a real regression. The retry runs inside the deploy-window lane the step already acquired (no re-queue)..github/workflows/ci.yml:Teststep now runs./scripts/deploy-window-lock.sh run -- ./scripts/ci-vitest-run.sh(still inside the bounded verification pool, per the existing heavyweight-command invariant).tests/ci-vitest-run.test.ts(new, 9 specs): locks in the retry boundary — retries once and only on the startup-timeout signatures, never on assertion failures or worker runtime crashes, retries at most once, and preserves exit codes.tests/deploy-window-lock.test.ts: updated the bounded-pool assertion to the new Test step command.Verification
ci-vitest-run,workflow-routing-hardening,production-candidate-workflow,self-hosted-node-cache-workflows,vitest-runner-budget,vite-config,deploy-window-lock— 51/51 tests pass.npm run typecheck(cf-typegen + react-router typegen + tsc -b) passes.shellcheck scripts/ci-vitest-run.shclean.Note
Low Risk
CI/test orchestration only; retries are limited to known Vitest pool timeout strings and cannot hide assertion failures.
Overview
Reduces flaky CI Test failures on the shared self-hosted runner when Vitest’s forks pool hits its hardcoded worker startup timeout.
npm testnow runsscripts/ci-vitest-run.shinstead of invokingvitest rundirectly, so CI, deploy verification, andlaunch:readinessall get the same behavior without workflow edits. The wrapper runs the suite once (default command unchanged), and retries exactly one time only if output matches Vitest’s forks-worker startup-timeout messages; other failures exit immediately with the original code.tests/ci-vitest-run.test.tsexercises that boundary with fake suite commands.tests/vitest-runner-budget.test.tsadds guards that per-file isolation stays enabled in config and that the retry wrapper stays signature-gated (deflake without turning offvi.mockreliability).Reviewed by Cursor Bugbot for commit e5fb8cc. Bugbot is set up for automated code reviews on this repo. Configure here.