Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): Claude steer test no longer hangs for 120s under CI load #22533

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/22533/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

ClaudeAdapterV2 > 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. juliusmarminge added labelsmacroscope-review

    2. Approvability

      Verdict: Approved at 3005790

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.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: fe27e8e · PR result: 3005790 · 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. Review in Change Stack →

      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.ts
      The 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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly identifies the affected test and the CI hang it fixes. It is concise, specific, and uses a conventional commit format.
      Description checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
      Comment `@coderabbitai help` to get the list of available commands.

Sign in to join this conversation.