Repository navigation
fix(probe): find the default installer's dependency venv for --gateway-runtime - #37
Merged
Merged
Conversation
…y-runtime The default Hermes installer starts the gateway on a bare bundled interpreter (~/.hermes/tools/python-*/bin/python3 -I) and keeps httpx in a generated venv under <HERMES_HOME>/installs/<id>/environments/<hash>/venv. Neither the gateway's argv[0] nor a python3 on its PATH can import httpx, so every candidate failed and the page showed "Found Python without httpx". Read the active environment from installs/<id>/facts.json (packages.venv.environment) and try it after the existing candidates. Other environments follow, newest first, when facts are missing. Named profiles resolve to the base home, where installs live. The venv path is kept unresolved, as for the other candidates. Fixes Adolanium#35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The /proc walk only accepts absolute POSIX interpreter paths. Building the bare interpreter path from the temp directory made it C:\... on Windows, so the walk skipped it and the test failed there.
Owner
|
Thanks for tracking this down and for testing it against a live Linux gateway. Reading I pushed one small commit (2be17ee) so the new facts test also passes on Windows. The |
7 of 8 tasks
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.
Summary
Fixes #35. With the default Hermes installer,
--gateway-runtimenever finds a Python that can import httpx, so the page shows "Found Python without httpx on this Gateway". This happens on Linux too, not only on macOS.The installer starts the gateway on a bare bundled interpreter,
~/.hermes/tools/python-3.14.7+…/bin/python3 -I. Hermes's own packages, httpx included, live in a generated venv,<HERMES_HOME>/installs/<install-id>/environments/<hash>/venv, and the hash changes on every update. On a Linux SSH backend I traced Desktop'sshell.execcalls during a poll:"$HERMES_PYTHON"expands to nothing;hermes-agent/.venvandhermes-agent/venvdon't exist;python3andpythonresolve to the bundled interpreter, because itsbinis first on the gateway's PATH. A systempython3with httpx installed is never reached;_gateway_python_candidates()finds the same bundled interpreter as the parent's argv[0], andimport httpxfails there too.The installer already records the active environment in
installs/<install-id>/facts.jsonunderpackages.venv.environment, as #35 suggests.Changes
_hermes_install_pythons()readspackages.venv.environmentfrom eachinstalls/*/facts.jsonunder the Hermes homes, then adds the otherinstalls/*/environments/*/venvinterpreters newest first (bypyvenv.cfgmtime) for installs whose facts are missing or unreadable. Interpreters that don't exist are skipped, and venv paths stay unresolved, like the other candidates. A named profile home (<base>/profiles/<name>) also checks the base home, where installs live._gateway_python_candidates()appends these after the existing candidates, soHERMES_PYTHON,VIRTUAL_ENVand parent interpreters keep their priority. The 5-second budget in_use_gateway_pythonis unchanged; on this layout the bare interpreter fails its check at once.scripts/build_catalog.py._use_gateway_pythonre-execs from the bare interpreter into the installer venv. Three existing tests that assert exact candidate lists now patch_hermes_homes, so they don't depend on the machine's~/.hermes.Testing
scripts/build_catalog.py --checkis clean.main(8 failures across both probe copies) and pass with the change.python3first on PATH,--gateway-runtime --profile default --pin-snapshot --slice=0:8): onmainit returns only the "probe cannot import httpx" card. With this change it re-execs intoinstalls/<id>/environments/<hash>/venv/bin/pythonand returns the OpenRouter, Claude and DeepSeek cards.I couldn't test macOS. There's no
/procthere, so the facts and glob candidates are what discovery relies on. TheScripts/python.exebranch for Windows follows the existingVIRTUAL_ENVhandling and is untested.🤖 Generated with Claude Code