fix(setup): skip camofox npm install in uv tool-install mode (#66044) - #66908
fix(setup): skip camofox npm install in uv tool-install mode (#66044)#66908Enough1122 wants to merge 1 commit into
Conversation
…earch#66044) `_run_post_setup('camofox')` always runs `npm install --workspaces=false` in PROJECT_ROOT (Path(__file__).parent.parent.resolve()). On a source checkout PROJECT_ROOT is the repo root with package.json and works fine. On a `uv tool install` install, however, PROJECT_ROOT is ~/.local/share/uv/tools/hermes-agent/ — a uv-managed package dir with no package.json. The npm call exits non-zero (or, when `npm install` is preceded by `cd` into a non-package dir, errors out before reaching the uv installation step). Worse, install.sh deletes any pre-existing source checkout BEFORE the new install completes, so a camofox-choice crash during setup leaves the user with neither an old nor a new install: `uv tool list` is empty, ~/.hermes/hermes-agent is gone, the post-setup traceback ends in FileNotFoundError on the (now-deleted) checkout path. Detect uv mode by the absence of package.json in PROJECT_ROOT and skip the npm-install step. Users in that mode get a clear message to run `npx @askjo/camofox-browser` directly (or use the Docker image). Source checkout behavior is unchanged. Single-file change in hermes_cli/tools_config.py::_run_post_setup. No public API change. Fixes NousResearch#66044.
a0d63d9 to
cbff304
Compare
Related to #66044. This narrowly guards the uv-tool-install Camofox setup path while preserving source-checkout behavior. |
|
The branch was force-pushed after an earlier triage bot comment ( Current diff is single-file and matches the PR description exactly:
This AI-assisted PR was drafted by Hermes Agent on behalf of @Enough1122. Happy to rebase / split / close if reviewers prefer a different shape. |
|
Thanks for the focused investigation. This automated hermes-sweeper review found that the #66044 failure path is already addressed on current
The proposed package.json guard therefore targets an installer state that current main no longer reaches. |
Summary
_run_post_setup('camofox')inhermes_cli/tools_config.pyalways runsnpm install --workspaces=falseinPROJECT_ROOT = Path(__file__).parent.parent.resolve(). On a source checkout this resolves to the repo root (withpackage.json) and works fine.On a
uv tool installinstall,PROJECT_ROOTresolves to~/.local/share/uv/tools/hermes-agent/— a uv-managed package directory with nopackage.json. Thenpm installcall then either errors out (npm ERR! ... doesn't have any package.json) or, depending on cwd, runs but fails.Worse,
install.shdeletes any pre-existing~/.hermes/hermes-agentsource checkout before the new install completes. So a camofox-choice crash during setup leaves the user with neither an old nor a new install:uv tool listis empty,~/.hermes/hermes-agentis gone, the post-setup traceback ends inFileNotFoundErroron the now-deleted checkout path. Issue #66044.This affects every Linux user who picks camofox during
hermes setupon auv tool installinstall, plus every user who previously had a source-based install and tried to migrate viainstall.sh.Fix
Detect uv mode by the absence of
package.jsoninPROJECT_ROOTand skip thenpm installstep entirely. Users in that mode get a clear message to runnpx @askjo/camofox-browserdirectly (or use the Docker image).Source-checkout behavior is unchanged —
package.jsonis present, the existing install path runs as before.Single-file change in
hermes_cli/tools_config.py::_run_post_setup('camofox'). No public API change. No new imports.Test plan
uv tool install(no~/.hermes/hermes-agentcheckout).hermes setup.camofoxas the browser provider.FileNotFoundError); user sees a message saying "Skipping Camofox npm install (no source checkout found). Start the Camofox server directly: npx @askjo/camofox-browser".FileNotFoundError: '/home/<user>/.hermes/hermes-agent'and the user is left with no working install.Fixes #66044.