SIGN IN SIGN UP

fix(byoa): --stop no longer skips daemons whose argv contains `npx` (#37)

The command-line filter in killRunningDaemons() excluded one-shot CLI
invocations and the npx wrapper with a single regex:

    --(stop|status|…|pair)\b|\bnpx\b

`|` binds looser than the group, so `\bnpx\b` was not scoped to the `--`
prefix and matched anywhere in the command line. Any genuine long-running
daemon whose argv happened to contain `npx` was therefore spared.

That is not an edge case: `npx -y cumora@latest agent computer --server …`
is the LaunchAgent's ProgramArguments and what the docs and `--pair` output
tell users to run. For those, `--stop` found the pid via its pgrep sweep,
discarded it, and reported "service removed and daemon process(es) killed"
without having killed anything — leaving a daemon still holding wake-streams
and processing turns, with no sign anything was missed. Recording the pid in
running.json did not help, since that candidate is filtered by the same
predicate.

Split the one-shot check into its own anchored regex and drop the npx
exclusion entirely: self/parent protection already comes from removing
process.pid / process.ppid from the candidate set, so the wrapper exclusion
was both wrong and unnecessary. Killing the wrapper's child stops the daemon
and the wrapper exits with it.

Extracted as `isStoppableDaemonCommand` so the classification is testable
directly, matching how isStaleResumeError is covered.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
B
BillyKing committed
90fd9ae8bc42a477168eb109717291dd567993f5
Parent: 5a8a08f
Committed by GitHub <noreply@github.com> on 8/20/2026, 3:49:59 AM