Skip to content

fix: detect uv tool install in _cmd_update_pip#29812

Closed
zombi3butt wants to merge 1 commit into
NousResearch:mainfrom
zombi3butt:fix/hermes-update-fails-uv-tool-install
Closed

fix: detect uv tool install in _cmd_update_pip#29812
zombi3butt wants to merge 1 commit into
NousResearch:mainfrom
zombi3butt:fix/hermes-update-fails-uv-tool-install

Conversation

@zombi3butt

Copy link
Copy Markdown

Bug Description

hermes update fails when Hermes is installed via uv tool install hermes-agent because _cmd_update_pip() runs uv pip install --upgrade hermes-agent which requires an active virtual environment. This was reported in #29700.

Root Cause

When installed via uv tool install, there's no venv and no .git directory. The update flow falls through to _cmd_update_pip() which runs uv pip install --upgrade hermes-agent — this fails with "No virtual environment found."

Fix

Detect the installation method at runtime in _cmd_update_pip():

  1. If hermes-agent appears in uv tool list output → use uv tool upgrade hermes-agent (the correct command for uv-tool installs)
  2. Otherwise → use uv pip install --upgrade --system hermes-agent (the --system flag allows installation into the global Python environment without a venv)
  3. Falls back to pip install --upgrade hermes-agent when uv is not available

How to Test

  1. Install Hermes via uv tool install hermes-agent
  2. Run hermes update — should now succeed with uv tool upgrade
  3. For pip-installed instances (with venv): behavior unchanged
  4. For pip-installed instances without venv: uses --system flag instead of failing

Cross-Platform Impact

Only touches subprocess command construction for the uv path. No file I/O, process management, or platform-specific code paths modified. Works on all three supported platforms (Linux, macOS, Windows).

When Hermes is installed via `uv tool install hermes-agent`, running

`hermes update` fails because `uv pip install --upgrade` requires a venv.

Fix by detecting the installation method and using the correct upgrade

command: `uv tool upgrade` for uv-tool installs, `--system` flag for

regular pip installs without a venv.

- Detect `hermes-agent` in `uv tool list` output -> use `uv tool upgrade`

- Otherwise, add `--system` flag to `uv pip install --upgrade`

- Falls back to `pip install --upgrade` when uv is not available

Closes NousResearch#29700
@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 21, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closed in favor of the consolidated fix PR #35248 (commit 4d7ea3f). It fixes the same uv-tool-install bug, plus pipx and bare-system-Python installs. Thanks for the contribution!

@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.

4 participants