fix(install): kill venv-resident gateway before recreating venv on Windows - #46726
Closed
Danamove wants to merge 1 commit into
Closed
fix(install): kill venv-resident gateway before recreating venv on Windows#46726Danamove wants to merge 1 commit into
Danamove wants to merge 1 commit into
Conversation
…ndows) The Windows venv-recreate guard only runs `taskkill /IM hermes.exe`, but the gateway that a scheduled task or watchdog autostarts runs as `pythonw.exe -m hermes_cli.main gateway run` straight out of venv\Scripts\. Its image name is python/pythonw, so taskkill never matches it; it keeps the venv's native extensions (e.g. tornado\speedups.pyd) loaded, and the following Remove-Item fails with "Access to the path is denied" -- aborting boot at the venv stage so the desktop app never loads. Additionally stop any process whose executable lives under this venv, matched by path so the image name is irrelevant and a global/system python outside the venv is never touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
Collaborator
|
Superseded by #52044 |
This was referenced Jul 30, 2026
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.
Problem
On Windows, the desktop app re-runs
scripts/install.ps1on every launch. When an update is pulled it recreates the venv. The existing guard beforeRemove-Item venvonly does:That misses the most common lock-holder. The gateway/agent that a scheduled task or watchdog autostarts runs as:
Its image name is
python/pythonw, nothermes.exe, sotaskkill /IM hermes.exenever matches it. It keeps the venv's native extensions loaded (observed ontornado\speedups.pyd; also_bcrypt.pyd), so the next line fails:The bootstrap aborts at the
venvstage and the desktop never loads — even though killing the leftover gateway and relaunching fixes it every time.Fix
Keep the existing
hermes.exetaskkill, and additionally stop any process whose executable lives under the venv being deleted, matched by path (ExecutablePath -like "$venvRoot\*") so:python.exe/pythonw.exe/hermes.exeall caught), andScoped to
Install-Venv, Windows-only, no behavior change on other platforms.Test
[System.Management.Automation.Language.Parser]::ParseFile(...)→ parses cleanly.venv\Scripts\pythonw.exelockingspeedups.pyd); with the leftover venv-resident process stopped,Remove-Item venvand the full bootstrap (venv → dependencies → … → ready) complete.🤖 Generated with Claude Code