fix(update): stop Windows gateways before mutating install - #45457
Closed
helix4u wants to merge 1 commit into
Closed
fix(update): stop Windows gateways before mutating install#45457helix4u wants to merge 1 commit into
helix4u wants to merge 1 commit into
Conversation
helix4u
marked this pull request as ready for review
June 13, 2026 07:58
Contributor
Author
tonydwb
approved these changes
Jun 13, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix: on Windows, stop running gateway processes before mutating the Hermes install directory. Without this, file locks on gateway DLLs cause corrupted reinstalls or failures.
Looks Good
- Proper process enumeration and graceful shutdown with SIGTERM, then SIGKILL as fallback
- Profiles with running gateways are detected and warned separately
- Print statements are intentional CLI user feedback, not debug artifacts
- No security concerns
Contributor
|
Closing this one since it already landed in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Stops running Windows gateway processes before
hermes updatemutates the checkout or virtualenv, including the Desktop updater path that runshermes update --yes --gateway --force.The existing Windows
hermes.execoncurrent-instance guard does not catch installed gateways because the scheduled/startup gateway wrapper runs throughpythonw.exe -m hermes_cli.main ... gateway run. Those processes can still keep files from the checkout or venv locked while git/uv update the install. This PR uses the existing gateway PID discovery and planned-stop marker path so profile gateways drain cleanly before update mutation, then relaunches the paused profiles after the update completes.This is intentionally separate from #39487, which pauses Windows gateways only when
gateway_modeis false and therefore does not cover the Desktop--gateway --forceupdate path.Related Issue
Fixes #
Type of Change
Changes Made
hermes_cli/main.py: add a Windows-only pre-update gateway pause that discovers all gateway PIDs, writes planned-stop markers for mapped profile gateways, force-stops unmapped/surviving matched gateway PIDs, and resumes mapped profile gateways after normal update exits.hermes_cli/main.py: hook the pause/resume around git and ZIP update mutation paths, including earlyAlready up to datereturns andatexitfallback for failure exits.tests/hermes_cli/test_update_concurrent_quarantine.py: cover mapped profile gateway pause marker behavior, unmapped PID escalation, and post-update profile relaunch.How to Test
pythonw.exe.hermes update --yes --gateway --force.Local verification run here:
python -m py_compile hermes_cli/main.py tests/hermes_cli/test_update_concurrent_quarantine.pygit diff --check -- hermes_cli/main.py tests/hermes_cli/test_update_concurrent_quarantine.pyI did not run the full pytest suite locally.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Local verification:
python -m py_compile hermes_cli/main.py tests/hermes_cli/test_update_concurrent_quarantine.py
git diff --check -- hermes_cli/main.py tests/hermes_cli/test_update_concurrent_quarantine.py