diff --git a/companion/src-tauri/src/lib.rs b/companion/src-tauri/src/lib.rs index add0e72..1558a3a 100644 --- a/companion/src-tauri/src/lib.rs +++ b/companion/src-tauri/src/lib.rs @@ -507,13 +507,6 @@ async fn restart_claude_desktop() -> Result { use std::path::PathBuf; use std::process::Command; - // Best-effort graceful close (no `/F`). If Claude is already gone - // taskkill returns exit code 128 — we don't surface that. - let _ = no_window( - Command::new("taskkill").args(["/IM", "Claude.exe"]), - ) - .output(); - // Capture the path of the running Claude.exe *before* we tell it // to quit — that's the most reliable way to find the right binary // (covers MSIX/Store installs, custom install dirs, renames), @@ -525,6 +518,14 @@ async fn restart_claude_desktop() -> Result { // existing candidate path, which silently picks the older binary // when both NSIS and MSIX installs coexist (mid-upgrade), and // misses Store-installed Claudes entirely. + // + // History: an earlier taskkill block was duplicated *above* the + // sysinfo lookup at some point between v0.4.40 and v0.4.46, which + // defeated the whole point — by the time sysinfo ran, Claude was + // already gone and the fallback paths ended up being the only + // resolution. Codex spotted the regression in the v0.4.40→main + // audit. The single, post-capture taskkill below is the + // intended order. let running_exe: Option = { use sysinfo::{ProcessRefreshKind, RefreshKind, System}; let sys = System::new_with_specifics(