Files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 c8270dc429 fix(dev): reap orphaned agent processes on dev/staging exit
Ctrl+C on `just dev`/`just staging` tears down the Tauri app before its
in-process system sweep can finish, so agent workers spawned in their own
process groups survive as orphans and accumulate across sessions.

Add an EXIT trap that reaps this instance's agents via the PID-file receipts
the desktop already writes (one PGID per agent under
`<app-data>/agents/agent-pids/`). The app-data dir is keyed by the bundle
identifier, so the cleanup is scoped exactly to the instance that ran the
recipe — the main checkout never reaps a worktree's agents, or vice versa.

PID files are matched instead of the `SPROUT_MANAGED_AGENT` env marker because
macOS `pkill -f` matches only argv, not the environment, so an env-marker match
would silently reap nothing.

Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-10 15:18:05 -04:00
..