Skip to content

fix(server): stop Claude probe stubs from outliving the test run - #57

Merged
yordis merged 2 commits into
mainfrom
yordis/fix-orphaned-probe-stubs
Sep 20, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/fix-orphaned-probe-stubs

Conversation

@yordis

@yordis yordis commented Sep 20, 2026

Copy link
Copy Markdown
Member
  • The capability probe aborts the SDK without awaiting the child's exit, so a stub kept open by an unconditional interval has nothing left to end it once its stdin closes. It is reparented to init and survives until reboot.
  • Every run of these two files therefore strands another process. Machines running the suite regularly accumulate them silently, days-old ones were found still resident with their temp directories already deleted.
  • Tying the stub's lifetime to its stdin keeps the behaviour the interval was there for, staying alive across the initialize then get_usage exchange, without letting it outlive the pipe that feeds it.

Summary by CodeRabbit

  • Tests
    • Improved test reliability by ensuring simulated provider processes shut down cleanly after interrupted or completed probes.
    • Prevented lingering background processes during provider lifecycle and restart scenarios.
    • No user-facing functionality or public APIs were changed.

The probe aborts the SDK without awaiting the child, so a stub held open
by an unconditional interval is reparented to init and survives until
reboot, accumulating one stranded process per run.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Sep 20, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes only test fixture scripts and fork documentation; no runtime server or product code paths are modified.

Overview
Test-only fix: embedded fake Claude binaries in capability-probe and provider-registry tests no longer stay alive indefinitely after the parent probe aborts the SDK without waiting for the child.

Instead of an unconditional keep-alive interval, those stubs now clear the interval and call process.exit(0) when stdin closes, so they still survive the initialize / follow-up control exchange but do not accumulate one stranded process per test run.

Fork ledger 0025 documents the silent leak and notes the change is upstream-friendly test-harness hygiene with no product behavior impact.

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: TrogonStack/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3a717f2d-c711-4eb8-894a-7f64daf813f7

📥 Commits

Reviewing files that changed from the base of the PR and between 1da50fe and bed08e0.

📒 Files selected for processing (2)
  • docs/fork/0025-a-test-run-leaves-no-processes-behind.md
  • docs/fork/README.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TrogonStack/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7b19cbdc-9a6c-4eb1-bf62-eb8ea7599c80

📥 Commits

Reviewing files that changed from the base of the PR and between 964b00e and 1da50fe.

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

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Claude test fixtures now store their keep-alive intervals, clear them when stdin closes, and exit with code 0. This prevents child processes from remaining active after probe shutdown.

Changes

Claude fixture lifecycle

Layer / File(s) Summary
Mock child process shutdown
apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts, apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts
The Claude child scripts clear their keep-alive intervals on stdin closure and exit cleanly.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: juliusmarminge, t3dotgg

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preventing Claude probe stubs from outliving the test run.
Description check ✅ Passed The description clearly explains what changed and why. It omits the template headings and checklist, but it provides the essential change, problem, and solution details.
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…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

The ledger is the only place a divergence living entirely in test
fixtures is visible, since a sync that reverts it fails nothing.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@github-actions github-actions Bot added size:M and removed size:S labels Sep 20, 2026
@yordis
yordis merged commit e79cb5e into main Sep 20, 2026
20 checks passed
@yordis
yordis deleted the yordis/fix-orphaned-probe-stubs branch September 20, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant