Files
hermes-agent/tests/hermes_cli
emozilla c3c7bfba00 fix(update): exclude parent hermes.exe shim from concurrent-instance check
The uv-generated hermes.exe console-script shim is a launcher that spawns
python.exe as a child and waits for it. cmd_update runs inside the python
child, so os.getpid() is the child's PID — but the parent hermes.exe shim
is alive the whole time. _detect_concurrent_hermes_instances was excluding
the child PID but not the parent shim, so every 'hermes update' invocation
falsely reported itself as 'another running instance' with a fresh PID.

Walk psutil.Process(exclude_pid).parents() and add any ancestor whose exe
matches one of our shims (hermes.exe / hermes-gateway.exe) to the
exclusion set. Off-Windows behaviour unchanged. Ancestor-enumeration
failure degrades to the historical 'exclude only self' behaviour.

Adds two regression tests covering the parent-shim exclusion and the
psutil-failure fallback.
2026-05-24 22:38:52 -04:00
..