You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect the hermes console script from the active Python environment's platform-aware scripts directory.
Treat a healthy wheel-installed virtualenv entry point as self-contained instead of requiring or creating a global ~/.local/bin/hermes symlink.
Preserve the existing source-checkout candidates, global-link checks, and remediation.
For a wheel layout with a missing script, recommend reinstalling the package with the active interpreter instead of suggesting an editable install from site-packages.
Root cause and impact
For a wheel install, PROJECT_ROOT resolves inside site-packages, but the console script lives in the virtualenv's scripts directory. The doctor check only searched PROJECT_ROOT/venv and PROJECT_ROOT/.venv, so a healthy ordinary virtualenv produced a false Venv entry point not found warning. Its remediation also assumed a source checkout and suggested pip install -e from site-packages.
After locating the active environment's console script, the source-oriented global symlink check must also be skipped. Otherwise the original false warning is merely replaced with ~/.local/bin/hermes not found, and doctor --fix leaks an isolated wheel venv into the user's global command path.
The updated check uses sysconfig.get_path("scripts") only when Python reports an active virtualenv, keeps the existing source layout behavior, skips the global link requirement only for an external wheel environment, and safely falls back when the environment path cannot be resolved.
Built the changed wheel, installed it into a fresh Python 3.11 virtualenv, and ran hermes doctor with an isolated HOME. Doctor reported the venv entry point as present and did not create or request ~/.local/bin/hermes.
Regression coverage runs both doctor and doctor --fix against a wheel layout with no global link and verifies neither mode creates one.
Full scripts/run_tests.sh -j 8 from the earlier revision — 43,564 passed; 49 unrelated failures across 20 files plus 2 unrelated provider test files timed out on this macOS host. Failures were in existing platform/tooling paths such as systemd, missing Node, macOS /tmp resolution, and network safety fixtures; none touched the changed doctor code or tests.
Addresses the ordinary PyPI wheel + virtualenv doctor facet of #49529.
This intentionally does not change the separate optional-skills packaging facet tracked in the same issue.
Closing this after re-auditing against current main.
#68217 has since merged and deliberately removes PyPI wheel/sdist as supported Hermes distribution paths; setup.py now rejects wheel/sdist builds outside the sealed Nix path, and the supported matrix is git installer, Docker, Nix/NixOS, and editable development installs. This PR's only behavior change is for an ordinary wheel-installed virtualenv, so its premise no longer matches the project's current direction.
The implementation and focused tests remain internally sound, but merging it would revive handling and remediation (pip install --force-reinstall hermes-agent) for a retired installation path. Withdrawing it avoids carrying obsolete compatibility code. The source-checkout doctor behavior is left unchanged.
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
area/install-updateInstaller, updater, packaging, wheels, doctorcomp/cliCLI entry point, hermes_cli/, setup wizardP2Medium — degraded but workaround existssweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradestype/bugSomething isn't working
2 participants
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.
Summary
hermesconsole script from the active Python environment's platform-aware scripts directory.~/.local/bin/hermessymlink.site-packages.Root cause and impact
For a wheel install,
PROJECT_ROOTresolves insidesite-packages, but the console script lives in the virtualenv's scripts directory. The doctor check only searchedPROJECT_ROOT/venvandPROJECT_ROOT/.venv, so a healthy ordinary virtualenv produced a falseVenv entry point not foundwarning. Its remediation also assumed a source checkout and suggestedpip install -efromsite-packages.After locating the active environment's console script, the source-oriented global symlink check must also be skipped. Otherwise the original false warning is merely replaced with
~/.local/bin/hermes not found, anddoctor --fixleaks an isolated wheel venv into the user's global command path.The updated check uses
sysconfig.get_path("scripts")only when Python reports an active virtualenv, keeps the existing source layout behavior, skips the global link requirement only for an external wheel environment, and safely falls back when the environment path cannot be resolved.Validation
scripts/run_tests.sh tests/hermes_cli/test_doctor.py tests/hermes_cli/test_doctor_command_install.py tests/hermes_cli/test_doctor_dedicated_provider_skip.py— 89 passedruff check hermes_cli/doctor.py tests/hermes_cli/test_doctor_command_install.py— passedhermes doctorwith an isolated HOME. Doctor reported the venv entry point as present and did not create or request~/.local/bin/hermes.doctoranddoctor --fixagainst a wheel layout with no global link and verifies neither mode creates one.scripts/run_tests.sh -j 8from the earlier revision — 43,564 passed; 49 unrelated failures across 20 files plus 2 unrelated provider test files timed out on this macOS host. Failures were in existing platform/tooling paths such as systemd, missing Node, macOS/tmpresolution, and network safety fixtures; none touched the changed doctor code or tests.Addresses the ordinary PyPI wheel + virtualenv doctor facet of #49529.
This intentionally does not change the separate optional-skills packaging facet tracked in the same issue.