Skip to content

Windows: reliably terminate CLI process trees - #86

Merged
milind-soni merged 2 commits into
mainfrom
codex/pr-43-integration
Aug 14, 2026
Merged

Windows: reliably terminate CLI process trees#86
milind-soni merged 2 commits into
mainfrom
codex/pr-43-integration

Conversation

@milind-soni

Copy link
Copy Markdown
Owner

Integrates and hardens #43 on top of the centralized cross-platform process layer now on main.

  • terminate the full Windows child tree with taskkill /T /F
  • handle asynchronous taskkill launch/failure safely and fall back to stopping the owned CLI
  • skip already-exited children
  • add an end-to-end regression proving a spawned grandchild is reaped
  • preserve the newer shared driver spawning and permission-broker work

Local verification: 190 tests passed (7 platform-specific skips), typecheck, Electron syntax checks, and production build.

Closes #43

E4B-labs and others added 2 commits August 13, 2026 02:50
Stopping a turn on Windows leaves the CLI's MCP servers running.

Every driver spawns its CLI with `detached: true` specifically so the
CLI leads its own process group and `process.kill(-pid)` reaps the group
— the CLI plus every server and helper it started. Process groups are a
POSIX concept: on Windows `process.kill(-pid)` throws EINVAL, the catch
falls through to `child.kill()`, and that terminates the CLI alone.
Each interrupted or completed turn orphans the MCP servers it started,
and they accumulate for as long as the app runs.

Windows tracks a parent/child tree instead, which is what `taskkill /T`
walks. killTree() picks the right one per platform and keeps the
existing best-effort behaviour: it never throws, and it falls back to
child.kill() if taskkill is unavailable.

Used by all three drivers (claude, codex, acp/core) in place of the
identical inline stop() each carried.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgJeiantdRcZSBrc5sqqCp
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@milind-soni, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 11b68181-b5f9-4243-9e8b-39ef250a957c

📥 Commits

Reviewing files that changed from the base of the PR and between 1b06b3a and 2855d0f.

📒 Files selected for processing (2)
  • server/kill-tree.test.ts
  • server/procs.ts

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

@milind-soni
milind-soni merged commit f621a6f into main Aug 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants