Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): the fake Claude CLI exits with its parent #14926

Mergedyordis(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/14926/headmerged by juliusmarminge View on GitHub

Problem

Every run of ClaudeCapabilitiesProbe.test.ts leaves an orphaned node .../fake-claude.mjs process behind. The probe aborts the SDK without awaiting its child, and the fake CLI keeps itself alive with an unconditional setInterval, so it is reparented to PID 1 and runs until reboot. On a machine that runs the suite often, these pile up.

Change

The fake CLI still stays alive for follow-up control requests, but exits once its stdin closes, which happens when the parent goes away.

Scope and approval

A test-only fix for an obvious bug. No product code changes.

Verification

  • vp test run apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts: 3 passed.
  • Without the change, all tests still pass and ps -axo pid,ppid,command | grep fake-claude shows a leftover process with parent PID 1 after the run. With the change, none remain.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 54bcf16

      Macroscope's review found this PR approvable — The single ignored test-harness change makes the fake Claude CLI terminate when its parent closes stdin, preventing orphaned processes without affecting product runtime behavior or defaults.

      Notes:

      • Diff unchanged. 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. juliusmarminge added labelsmacroscope-review

    4. Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      🧰 Additional context used
      📚 Code guidelines (1)
      docs/internals/effect-services.md — configured

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: fd825268-5482-42d9-8621-312c8f6354a4
      📥 Commits

      Reviewing files that changed from the base of the PR and between fd7ee2c30a7eeef910c99e7bc92e944526555db7 and 54bcf16853961435ee2a60b2413e60cd19abe062.

      📒 Files selected for processing (1)
      • apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts

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


      📝 Walkthrough

      Walkthrough

      The fake Claude SDK process keeps its stdin handler active for follow-up control requests. It clears its keep-alive timer and exits when stdin closes.

      Changes

      Claude probe test

      Layer / File(s)Summary
      Fake SDK process lifetime
      apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
      The fake SDK process uses a named keep-alive timer. It clears the timer when stdin closes, allowing the process to exit.

      Priority: ⬇️ Low

      Estimated code review effort: 1 (Trivial) | ~3 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 54bcf

      The test fake can handle follow-up requests and exit when stdin closes. No actionable merge-blocking risk is established.

      Architecture Summary

      Architecture risk: 🔵 Low · up to 54bcf

      The change affects 1 system.

      Changed systems: apps/server

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — apps/server (service) was modified; 1 changed file maps to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts: The fake SDK process replaces an unconditional interval with a named keep-alive timer that remains active for control requests and is cleared on stdin close, when the process exits.
      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the test-only change: the fake Claude CLI exits with its parent. It follows the repository's conventional commit format.
      Description check✅ PassedThe description covers the problem, the change, scope justification, and focused verification results. It explains the orphaned process and confirms that the updated test leaves no process behind.
      Docstring Coverage✅ PassedNo 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 1…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged this6414268

    6. juliusmarminge closed this

Sign in to join this conversation.