feat(cli): add 'chrome-use daemon restart|status' to reset stuck session state

A mid-session 'chrome-use upgrade' (or a crashed worker) can leave per-session
daemons holding stale/cross-leaked tab handles, and the only fix was hunting
PIDs with pgrep/kill. Add a first-class command:

- 'daemon restart' kills every session daemon worker (SIGTERM→SIGKILL +
  sidecar cleanup) but leaves the Chrome-launched __nm-host bridge alone, so
  the extension relay stays up — the next command spins a fresh, clean daemon
  against the same live Chrome. Closes no tabs.
- 'daemon status' lists running session daemons (pid + version) and relay state.

Wires connection::restart_all_daemons(), skips the command in the update-notify
nag, documents it in --help and the core skill. Unit tests cover the empty case
and a live-session kill (spawns a real child, asserts it's reaped + sidecars
cleaned). Issue #20.
This commit is contained in:
leeguooooo
2026-06-13 16:42:53 +09:00
parent 7601919a04
commit c0ee65d0d8
5 changed files with 181 additions and 3 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ pub fn maybe_notify_update() {
if first.starts_with("__")
|| matches!(
first.as_str(),
"upgrade" | "install" | "doctor" | "dashboard"
"upgrade" | "install" | "doctor" | "dashboard" | "daemon"
)
{
return;