hermes-agent/apps/bootstrap-installer/src-tauri
Teknium f72690825e
fix(desktop/windows): stop in-app update from cascading into a backend restart loop (#50381)
When a Windows user relaunches Hermes while an in-app update is still
running (the desktop vanished with no progress and looks crashed), the
fresh instance spawns its own dashboard backend. That backend re-locks
the venv shim, the updater's straggler cleanup (force_kill_other_hermes
-> taskkill /F /T /IM hermes.exe) kills it, the launch dies with the 45s
"backend didn't come up" timeout, and the user relaunches into the same
trap -- an infinite respawn/kill loop (#50238).

Root cause: no mutual exclusion between an applying update and a fresh
desktop spawning its own local backend.

Fix: the updater publishes a HERMES_HOME/.hermes-update-in-progress
marker (pid + start time) for the whole run via an RAII drop-guard that
removes it on every exit path (success, early return, panic). A
freshly-launched desktop checks the marker before spawning its local
backend and PARKS until the update finishes -- then brings the backend
up itself (it is the surviving instance; the updater's own relaunch hits
the single-instance lock and quits). A stale marker (dead pid or past a
20-minute ceiling) is pruned so a crashed updater can never strand
future launches. No rogue backend spawns mid-update, so
force_kill_other_hermes has nothing legitimate to kill.

Marker parse/staleness logic is extracted to update-marker.cjs and
unit-tested; the Rust guard has unit tests; the Rust-write <-> JS-read
contract is E2E-verified.
2026-06-21 13:10:32 -07:00
..
capabilities Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
icons Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
src fix(desktop/windows): stop in-app update from cascading into a backend restart loop (#50381) 2026-06-21 13:10:32 -07:00
build.rs feat(installer): make commit pinning opt-in, default to branch-follow 2026-06-01 21:35:46 -04:00
Cargo.toml Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
hermes-setup.manifest Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
tauri.conf.json feat(installer): rename macOS installer to "Hermes" and make it a launcher (#37516) 2026-06-02 17:47:34 +00:00