hermes-agent/apps/bootstrap-installer/src-tauri/src
brooklyn! 98528c78c1
fix(desktop/windows): stop racing our own backend during in-app update (#39828)
* fix(desktop/windows): stop racing our own backend during in-app update

The Windows in-app update (Update button -> hermes-setup.exe --update handoff)
bricked because it raced a still-locked hermes.exe: the desktop quit
fire-and-forget without reaping its backend child + grandchildren, so when
the updater ran `hermes update`, the venv shim was still open. The quarantine
rename then failed, uv's `pip install -e .` hit "Access is denied", the git
path bailed to a full ZIP re-download, and the deps still couldn't write the
locked shim -- leaving a half-applied install. macOS is fine because it never
blocks REPLACE on a running executable.

Three coordinated fixes restore Mac-style parity (click Update -> progress ->
relaunch, no terminal):

A. Desktop (main.cjs): before spawning the updater, releaseBackendLockForUpdate()
   tree-kills the primary + pool backends (taskkill /T /F on Windows, to catch
   REPL/pty/gateway grandchildren that SIGTERM misses) and polls the venv shim
   until it is actually writable (bounded 15s) -- so the lock is gone before we
   hand off. Also fixes resolveHermesCliBinary to use venv\Scripts\hermes.exe on
   Windows.

B. Updater (update.rs): wait_for_venv_free no longer "proceeds anyway" on
   timeout -- it force-kills any lingering hermes.exe (excluding itself) and
   re-checks, so a straggler can't doom the install.

C. Updater (update.rs): pass --force to `hermes update`. By contract the desktop
   has exited + waited, and the wait force-kills stragglers, so the running-exe
   guard would only produce a false "Hermes is still running" dead-end.

Verified: node --check on main.cjs, cargo check on the updater (clean), and the
Windows-gated taskkill body type-checks standalone. Field repro: ryanc's
update.log (manual + handoff both hit the same lock cascade).

* review: scope backend kill+wait to Windows; drop meaningless POSIX pgid kill
2026-06-05 08:33:53 -05:00
..
bootstrap.rs test(installer): cover the post-update relaunch/install target derivation 2026-06-03 12:02:07 -07:00
events.rs fix(installer): stop mislabeling stdout-style progress as stderr 2026-06-03 10:38:34 -05:00
install_script.rs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
lib.rs feat(installer): rename macOS installer to "Hermes" and make it a launcher (#37516) 2026-06-02 17:47:34 +00:00
main.rs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
paths.rs Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
powershell.rs fix(desktop): self-update rebuilds and relaunches cleanly on macOS 2026-06-03 10:19:44 -05:00
update.rs fix(desktop/windows): stop racing our own backend during in-app update (#39828) 2026-06-05 08:33:53 -05:00