fix(windows): exclude system processes from venv holder detection (#57829) - #58343
Closed
nankingjing wants to merge 1 commit into
Closed
fix(windows): exclude system processes from venv holder detection (#57829)#58343nankingjing wants to merge 1 commit into
nankingjing wants to merge 1 commit into
Conversation
…sses (NousResearch#57829) On Windows, _detect_venv_python_processes was accidentally matching system processes (Registry, MemCompression) because psutil sometimes returns cmdline or cwd fragments that contain the venv prefix. Add a denylist: skip any process whose executable lives under C:\Windows\System32\ or C:\Windows\ — these are system components and can never be Hermes processes. Fixes NousResearch#57829 Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Duplicate of #57852 — both add the same Windows system-process denylist to |
Contributor
Author
|
Closing per @alt-glitch triage — duplicate of earlier canonical fix. Keeping the approach on our fork. Thanks for the review. |
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.
Closes #57829
Summary
On Windows,
hermes updatewas blocked because_detect_venv_python_processes()flagged system processes (Registry, MemCompression) as Hermes venv-holders. The user had to work around it with--force-venv.Root Cause
_detect_venv_python_processes()iterates all processes and matches them via executable path, cmdline, or working directory. The cmdline/cwd fallback checks (added to catch uv trampolines) could accidentally match a system processs working directory or cmdline fragment that happened to contain the venv prefix.Fix
+6 lines: add a denylist. Any process whose executable lives under `C:\Windows\System32\ is skipped before the cmdline/cwd fallback checks. These are Windows system components and can never be Hermes processes.
Scope
hermes_cli/main.py—_detect_venv_python_processes()function