Skip to content

kew stop

Emergency stop for the whole fleet. Kills every in-flight agent run and latches dispatch — nothing new starts until you run kew resume.

kew stop
kew stop --reason "runaway spend on issue #42"

What it does

  1. Engages the fleet-stop latch first, so no new dispatches start while the kill proceeds.
  2. For every in-flight run: verifies the recorded process group still belongs to a kew-launched agent (guards against PID reuse), marks the run killed in the run store, then sends SIGTERM to the process group, waits up to 10 seconds, and SIGKILLs survivors.
  3. Resets affected issues from in-progress back to ready.
  4. Preserves worktrees — killed work is recoverable.
  5. Records a fleet_stop event in the audit trail (kew audit tail).

Killed runs appear in kew status with status killed (not failure), so operator stops are distinguishable from failures in history and analytics.

Options

Option Description
--reason TEXT Recorded on the latch, shown by kew status and refusal messages

Notes

  • Running kew stop with nothing in flight still engages the latch — that is the point of a circuit breaker.
  • Running it twice is harmless; the second invocation reports the fleet is already stopped.
  • There is no --force bypass on dispatch commands. kew resume is the only way back.