Skip to content

fix(windows): exclude system processes from venv holder detection (#57829) - #58343

Closed
nankingjing wants to merge 1 commit into
NousResearch:mainfrom
nankingjing:fix/57829-windows-venv-holders-false-positive
Closed

fix(windows): exclude system processes from venv holder detection (#57829)#58343
nankingjing wants to merge 1 commit into
NousResearch:mainfrom
nankingjing:fix/57829-windows-venv-holders-false-positive

Conversation

@nankingjing

Copy link
Copy Markdown
Contributor

Closes #57829

Summary

On Windows, hermes update was 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

…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>
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #57852 — both add the same Windows system-process denylist to _detect_venv_python_processes() for #57829 (#57852 is the earlier open canonical fix). Note: this PR also bundles an undisclosed second change not mentioned in the title/body — hermes_cli/dashboard_auth/routes.py adds a password-provider login-form redirect for #58166. Reviewers may want that isolated into its own focused PR.

@nankingjing

Copy link
Copy Markdown
Contributor Author

Closing per @alt-glitch triage — duplicate of earlier canonical fix. Keeping the approach on our fork. Thanks for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: _find_venv_holders false positive on Windows - flags system processes as Hermes processes, blocking update

2 participants