Repository navigation
Description
Severity: P2
Where
packages/cli/src/commands/uninstall.rs:196-197: #[cfg(not(any(target_os = "macos", target_os = "linux")))] fn stop_daemon() {}; also remove_bin_dir (:199-201, let _ = fs::remove_dir_all(...)) and the unconditional success print at :75-78 (println!("NodeSpace uninstalled. ...")).
What goes wrong
The command is registered on every platform (packages/cli/src/lib.rs:207-208, :871) and its help says "stop daemon, remove binaries and service registration". On Windows stop_daemon does nothing, so the running nodespaced keeps running and the NodeSpaceDaemon value under HKCU\Software\Microsoft\Windows\CurrentVersion\Run stays, so the daemon starts again at next login. remove_bin_dir discards the remove_dir_all error, which on Windows fails while nodespaced.exe (or the running nodespace.exe) is open, and the command still prints "NodeSpace uninstalled." This contradicts packages/skill/references/cli.md:1022.
Evidence
- Verified on current main:
stop_daemonis still the empty Windows stub;remove_bin_dirandremove_sockstill ignore errors; the success line is unconditional. - The app registers the autorun in
packages/desktop-app/app-lib/src/daemon_setup.rs(register_autorun_windows, valueWINDOWS_AUTORUN_VALUE = "NodeSpaceDaemon", ~:2621, :3046). The only remover,remove_autorun_windows(:3121), ispub(crate)in app-lib and reachable only from the Settings UI; the CLI never calls it. - The CLI has Named Pipe transport (
packages/cli/src/lib.rs:291-333), so it can reach the daemon on Windows. - Related, closed: Show an uninstall path for the Windows daemon autorun entry #1519 added the in-app removal only. No open issue covers the CLI path.
Suggested fix
Make the Windows path of uninstall do what the other platforms do, and never print success on failure:
- Implement a Windows
stop_daemon: ask the daemon to shut down over its pipe (or, failing that, terminate thenodespaced.exeprocess by image path under the statebindir), then wait for the pipe to disappear. - Remove the autorun value:
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v NodeSpaceDaemon /f(check presence first so "not present" is not an error). Move the small registry helper somewhere the CLI can use (the CLI cannot depend on app-lib), or duplicate the few lines. - Stop swallowing
remove_dir_allerrors: return them (or collect them), print which paths could not be removed and why, and exit non-zero without printing "NodeSpace uninstalled." If the runningnodespace.exesits in the directory being deleted, remove everything else and report that file as the one the user must delete after the command exits. - Add tests for the error-reporting branch (a bin dir that cannot be removed yields
Errand no success line).
Found by
Found by an automated whole-codebase review on 2026-10-26; confirmed by independent verification against main on 2026-10-29.
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Nov 2, 2026
Picking this up (sweep drain).