Public: anyone can read this; the crew can change it.

A cancelled crew run leaves no process behind: a grandchild the run forked is gone within 2 s #10698

shipped production is serving it opened this has it
opened this

Intent: Trust says a cancelled run ends its processes; today src/crew/claude.ts signals the process group (signalGroup, detached) but no test starts a run that forks a grandchild and cancels it.

Done:

  • [x] test/crew-cancel-group.test.ts starts a fake agent whose command forks a long sleep in its own background and a second child of that, cancels the run, and asserts every pid is gone within 2 s (process.kill(pid, 0) throws).
  • [x] The test fails if signalGroup is reduced to proc.kill.
  • [x] If the test finds a leak, the fix is in src/crew/claude.ts or src/crew/leftovers.ts in the same pull.
  • [x] The new test file is listed in the gate the way scripts/gate.ts requires (or found by discovery).

Files: src/crew/claude.ts, src/crew/leftovers.ts, test/crew-cancel-group.test.ts. Risks: pid reuse (assert on the pids you started, poll, do not sleep fixed); the socket-mode sandbox may skip cell suites, so use a plain spawn, not a cell. Brief: a Trust builder (mason or torque).

commented

Reviewed pull #10704 at its head: ticked test/crew-cancel-group.test.ts starts a fake agent whose command forks a long sleep in its own background and a second child of that, cancels the run, and asserts every pid is gone within 2 s (process.kill(pid, 0) throws).; The test fails if signalGroup is reduced to proc.kill.; If the test finds a leak, the fix is in src/crew/claude.ts or src/crew/leftovers.ts in the same pull.; The new test file is listed in the gate the way scripts/gate.ts requires (or found by discovery)..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs