test(server): Claude steer test no longer hangs for 120s under CI load #22533
main fromrefs/pull/22533/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubClaudeAdapterV2 > moves the root's foreground subagents to the background before a steer (never answers) hangs until the 120s vitest timeout on loaded CI runners. It failed Test Server 7 on #22524 and on an unrelated PR in the same hour.
The cause is a TestClock race. steerTurn starts the backgrounding call on a forked fiber, then arms a 5-second timeout. The test waited for the call, then ran TestClock.adjust("5 seconds") once. When the adjust ran before the timeout's sleep existed, the timer never fired and the steer waited forever.
The test now advances the clock in 1-second ticks until the steer ends, and fails with a clear message after 100 ticks. The "answers after the steer went out" case answers through a Deferred instead of a second clock timer, so its order is fixed.
To check the fix, I added 50 Effect.yieldNow before the timeout in the adapter. The old test then hangs in both timeout cases. The new test passes all 6 cases. Production code is unchanged.
Created with Claude Opus 5.5 in Claude 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:M
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
3005790Macroscope's review found this PR approvable — This is a single-file test-harness change intended to eliminate a CI-only timing hang. The changes are confined to ignored testing code and do not alter production behavior or product defaults.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
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 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:
fe27e8e· PR result:3005790· 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.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
3ea93ad1-47fa-4782-918e-9f4de242bb1f
📥 Commits
-
Reviewing files that changed from the base of the PR and between fe27e8e3dc12dcbb108e9a28fd9b8cb65f34ae92 and 3005790fc529642cfa0a9519626003fe74270084.
📒 Files selected for processing: 1
-
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
📝 Walkthrough
-
The Claude adapter tests replace fixed sleeps and single clock advances with a deferred response signal and a helper that advances the test clock in one-second increments for timeout cases.
Changes: Steering test synchronization
Layer / File(s) Summary Coordinate steering test responses and timeouts
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsThe delayed-response case waits for a deferred signal, which the test releases explicitly. Timeout cases use a helper that advances the test clock in one-second increments until the steering fiber finishes or 100 ticks elapse. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Suggested reviewers:
shivamhwp
Merge Risk: ⚪ Minimal · up to
30057-
No actionable issue was found with the steering test change. It is ready to merge after the normal test and typecheck checks.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly identifies the affected test and the CI hang it fixes. It is concise, specific, and uses a conventional commit format. Description check The description explains the failure, root cause, code change, reproduction method, and verification results. It includes a related pull request link, but it does not use the required section headings… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description explains the failure, root cause, code change, reproduction method, and verification results. It includes a related pull request link, but it does not use the required section headings or explicitly document maintainer approval or the rationale for proceeding without prior approval.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes