Skip to content

[APP-3185] Kill generator process groups on cancellation - #14853

Draft
kevinyang372 wants to merge 2 commits into
masterfrom
kevinyang/p0-process-tree-cancellation
Draft

[APP-3185] Kill generator process groups on cancellation#14853
kevinyang372 wants to merge 2 commits into
masterfrom
kevinyang/p0-process-tree-cancellation

Conversation

@kevinyang372

Copy link
Copy Markdown
Member

Description

Fixes per-command cancellation for local generator commands so Warp terminates the entire process group rather than only the immediate shell or wrapper process.

This addresses an enterprise failure mode where a Git wrapper is killed with SIGKILL, its real Git child survives, and periodic prompt refreshes accumulate orphaned Git processes. Each generator already starts in a dedicated Unix process group; this change adds scoped ownership that removes PID bookkeeping and kills that group whenever the command future is dropped or errors. Normal completion disarms cleanup, while bulk session cancellation reuses the same group-termination path.

A real-process regression test starts a shell descendant behind a FIFO and verifies dropping the command future terminates the descendant before it can perform a side effect. A second test verifies normal completion removes the command from later bulk cancellation.

Linked Issue

  • Internal: APP-3185
  • The linked issue is labeled ready-to-spec or ready-to-implement. (N/A: internal Linear follow-up)
  • Where appropriate, screenshots or a short video are included below. (N/A: process-lifecycle change with no UI)

Testing

  • cargo nextest run -p warp 'local_command_executor::tests::unix' — 2 passed after merging current origin/master

  • Exact three Clippy commands from script/presubmit — passed after merging current origin/master

  • ./script/format --check — passed after merging current origin/master

  • Full ./script/presubmit — passed before the non-overlapping origin/master merge (10,872 workspace tests plus completer-v2 and doc tests)

  • Local platform: macOS

  • Linux cloud verification was not run because oz-dev is unavailable in the submitting environment; the new implementation and tests are Unix-gated

  • I have manually tested my changes locally with ./script/run (N/A: no interactive UI behavior)

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Agent artifacts

CHANGELOG-BUG-FIX: Fixed canceled background commands leaving wrapped child processes running.

Co-Authored-By: Warp agent@warp.dev

kevinyang372 and others added 2 commits August 8, 2026 12:07
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant