Skip to content

fix(setup): skip camofox npm install in uv tool-install mode (#66044) - #66908

Closed
Enough1122 wants to merge 1 commit into
NousResearch:mainfrom
Enough1122:fix/camofox-skip-npm-in-uv-install
Closed

fix(setup): skip camofox npm install in uv tool-install mode (#66044)#66908
Enough1122 wants to merge 1 commit into
NousResearch:mainfrom
Enough1122:fix/camofox-skip-npm-in-uv-install

Conversation

@Enough1122

Copy link
Copy Markdown
Contributor

Summary

_run_post_setup('camofox') in hermes_cli/tools_config.py always runs npm install --workspaces=false in PROJECT_ROOT = Path(__file__).parent.parent.resolve(). On a source checkout this resolves to the repo root (with package.json) and works fine.

On a uv tool install install, PROJECT_ROOT resolves to ~/.local/share/uv/tools/hermes-agent/ — a uv-managed package directory with no package.json. The npm install call then either errors out (npm ERR! ... doesn't have any package.json) or, depending on cwd, runs but fails.

Worse, install.sh deletes any pre-existing ~/.hermes/hermes-agent 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. Issue #66044.

This affects every Linux user who picks camofox during hermes setup on a uv tool install install, plus every user who previously had a source-based install and tried to migrate via install.sh.

Fix

Detect uv mode by the absence of package.json in PROJECT_ROOT and skip the npm install step entirely. 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 — package.json is 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

  1. Install via uv tool install (no ~/.hermes/hermes-agent checkout).
  2. Run hermes setup.
  3. Pick camofox as the browser provider.
  4. Expected: setup completes successfully (no FileNotFoundError); user sees a message saying "Skipping Camofox npm install (no source checkout found). Start the Camofox server directly: npx @askjo/camofox-browser".
  5. Without this fix: setup crashes with FileNotFoundError: '/home/<user>/.hermes/hermes-agent' and the user is left with no working install.

Fixes #66044.

…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.
@Enough1122
Enough1122 force-pushed the fix/camofox-skip-npm-in-uv-install branch from a0d63d9 to cbff304 Compare July 18, 2026 12:17
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard tool/browser Browser automation (CDP, Playwright) P3 Low — cosmetic, nice to have labels Jul 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #66044. This narrowly guards the uv-tool-install Camofox setup path while preserving source-checkout behavior.

@Enough1122

Copy link
Copy Markdown
Contributor Author

The branch was force-pushed after an earlier triage bot comment (alt-glitch) flagged the diff as a multi-fix superset. That comment was based on the initial push which had accumulated prior PR commits because I forgot to rebase onto main before opening the next branch — fixed now.

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.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused investigation. This automated hermes-sweeper review found that the #66044 failure path is already addressed on current main.

  • scripts/install.sh:1178-1188 preserves an interrupted checkout by moving it to a timestamped backup, and scripts/install.sh:1190-1269 updates a valid checkout in place rather than deleting it.
  • scripts/install.sh:2267-2273 runs setup from $INSTALL_DIR via its venv, so the Camofox post-setup cwd is the managed source checkout.
  • hermes_cli/tools_config.py:1282-1296 handles a failed Camofox npm invocation as a warning; it does not raise on npm's non-zero exit.
  • The related issue install.sh + setup with camofox provider: post-setup crashes on missing source dir, leaves no working hermes install #66044 is already closed after a current-main cannot_reproduce review.

The proposed package.json guard therefore targets an installer state that current main no longer reaches.

@teknium1 teknium1 closed this Jul 19, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 19, 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 P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main tool/browser Browser automation (CDP, Playwright) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install.sh + setup with camofox provider: post-setup crashes on missing source dir, leaves no working hermes install

3 participants