Skip to content

fix(update): export launcher virtualenv to uv (#35031)#35064

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-35031-update-venv-env
Closed

fix(update): export launcher virtualenv to uv (#35031)#35064
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-35031-update-venv-env

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • export VIRTUAL_ENV=sys.prefix when _cmd_update_pip() is running inside a real virtualenv
  • keep system-Python installs unchanged by only applying the env overlay when sys.prefix != sys.base_prefix
  • add a regression test covering the launcher-shebang case where Hermes runs from a venv interpreter but the shell environment lacks VIRTUAL_ENV

Why

hermes update could fail for PyPI installs launched from a venv-backed shim because uv pip install --upgrade hermes-agent inherited a shell without VIRTUAL_ENV, even though the running interpreter already knew its venv root via sys.prefix.

Verification

  • uv run --frozen --with pytest-timeout pytest tests/hermes_cli/test_cmd_update.py
  • git diff --check
  • uv run --frozen ruff check hermes_cli/main.py tests/hermes_cli/test_cmd_update.py

Scope

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard python:uv Pull requests that update python:uv code labels May 30, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #35224. Your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks for the fix!

@teknium1 teknium1 closed this May 30, 2026
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 P2 Medium — degraded but workaround exists python:uv Pull requests that update python:uv code type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes update fails with 'No virtual environment found' when launcher venv is not active in shell

3 participants