fix: detect uv tool install in _cmd_update_pip#29812
Closed
zombi3butt wants to merge 1 commit into
Closed
Conversation
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
1 task
Contributor
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.
Bug Description
hermes updatefails when Hermes is installed viauv tool install hermes-agentbecause_cmd_update_pip()runsuv pip install --upgrade hermes-agentwhich requires an active virtual environment. This was reported in #29700.Root Cause
When installed via
uv tool install, there's no venv and no.gitdirectory. The update flow falls through to_cmd_update_pip()which runsuv pip install --upgrade hermes-agent— this fails with "No virtual environment found."Fix
Detect the installation method at runtime in
_cmd_update_pip():hermes-agentappears inuv tool listoutput → useuv tool upgrade hermes-agent(the correct command for uv-tool installs)uv pip install --upgrade --system hermes-agent(the--systemflag allows installation into the global Python environment without a venv)pip install --upgrade hermes-agentwhen uv is not availableHow to Test
uv tool install hermes-agenthermes update— should now succeed withuv tool upgrade--systemflag instead of failingCross-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).