needle stop --all kills the tmux session; the workers then exit gracefully over the next few seconds. The post-kill check runs before they finish, reports them as orphans, and exits non-zero on what was a successful shutdown.
Reproducible on three consecutive stops (needle 0.6.0, Ubuntu 22.04.5 / WSL2).
$ needle stop --all && sleep 2 && pgrep -af "needle run" || echo clean
Error: 2 needle process(es) still running after kill attempt for session 'needle-claude-alpha':
PID 5963: ... --identifier alpha
PID 6006: ... --identifier bravo
can't find session: needle-claude-alpha
Error: needle-claude-alpha - kill attempt reported success but 2 process(es) still running
...
5963 ... --identifier alpha
6006 ... --identifier bravo
$ kill 5963 6006
-bash: kill: (5963) - No such process
-bash: kill: (6006) - No such process
$ pgrep -af "needle run" || echo clean
clean
Both processes had exited by the time kill ran. Nothing leaks — they were mid-shutdown when the check fired.
Impact: a script using needle stop --all as a gate treats a clean shutdown as a failure, and the error text names PIDs that no longer exist.
Suggested: poll for exit with a short grace period (5–10s) before declaring orphans, and distinguish "still running after the grace period" from "still running right now".
Possibly the same underlying behaviour as the ⚠️ Found 1 unregistered needle run process(es) warning I saw on v0.4.2 — a worker observed mid-flight rather than a genuine orphan.
needle stop --allkills the tmux session; the workers then exit gracefully over the next few seconds. The post-kill check runs before they finish, reports them as orphans, and exits non-zero on what was a successful shutdown.Reproducible on three consecutive stops (needle 0.6.0, Ubuntu 22.04.5 / WSL2).
Both processes had exited by the time
killran. Nothing leaks — they were mid-shutdown when the check fired.Impact: a script using
needle stop --allas a gate treats a clean shutdown as a failure, and the error text names PIDs that no longer exist.Suggested: poll for exit with a short grace period (5–10s) before declaring orphans, and distinguish "still running after the grace period" from "still running right now".
Possibly the same underlying behaviour as the
⚠️ Found 1 unregistered needle run process(es)warning I saw on v0.4.2 — a worker observed mid-flight rather than a genuine orphan.