hermes - ✅(Solved) Fix hermes update appears stuck at Node.js dependencies during Camofox postinstall [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#18840Fetched 2026-05-03 04:53:57
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×2renamed ×1

Error Message

hermes update silently waits during Node dependency installation. The raw traceback after Ctrl-C points at:

Root Cause

Because the updater runs npm with output captured/suppressed and no timeout, there is no visible progress, download status, or indication that a browser binary fetch is happening. From the user's perspective, the update is frozen until they press Ctrl-C.

Fix Action

Workaround

To recover locally after interruption:

cd ~/.hermes/hermes-agent
npm ci --ignore-scripts --no-fund --no-audit --progress=false
npm ci --ignore-scripts --no-fund --no-audit --progress=false --prefix ui-tui
hermes doctor

If Camofox itself is needed later, fetch it separately and visibly:

cd ~/.hermes/hermes-agent
npx camoufox-js fetch

PR fix notes

PR #18866: fix(cli): add timeout and progress output to npm install during update

Description (problem / solution / changelog)

Problem

hermes update appeared to hang indefinitely at "Updating Node.js dependencies..." because:

  1. npm install ran with --silent flag, suppressing ALL output (including progress from postinstall scripts like npx Camofox-js fetch)
  2. No timeout on subprocess.run() — if npm hangs, the update process hangs forever
  3. No progress indication to the user that something is happening during long downloads

Fix

  1. Added timeout=300 to _run_npm_install_deterministic() — prevents indefinite hangs. Both npm ci and npm install now have a 5-minute timeout per directory. TimeoutExpired exceptions are caught and converted to meaningful error messages instead of hanging.

  2. Replaced --silent with --loglevel=warn — shows warnings and errors (useful for debugging) while still suppressing the noisy progress bars and audit messages. Users can now see if something goes wrong instead of staring at a blank screen.

  3. Added progress message — prints "Installing {label}... (this may take a moment during postinstall scripts)" before each npm install so users know what's happening.

  4. Updated both call sites_update_node_dependencies() and _build_web_ui() both use the same function and both now pass timeout.

Fixes #18840

Changed files

  • hermes_cli/main.py (modified, +37/-16)

PR #18869: fix(update): stream npm install output so postinstall progress is visible (#18840)

Description (problem / solution / changelog)

Summary

hermes update appeared to hang silently at → Updating Node.js dependencies... for users on fresh installs, because the repo-root npm install ran with both --silent AND captured stdout/stderr — so the long-running postinstall script @askjo/camofox-browsernpx camoufox-js fetch (downloads a Firefox-fork browser binary, can take many minutes) printed nothing.

Reporter (#18840) verified the issue with the npm debug log and the captured traceback inside _run_npm_install_deterministic():

info run @askjo/[email protected] postinstall node_modules/@askjo/camofox-browser npx camoufox-js fetch || true
info run [email protected] postinstall { code: 0, signal: null }
info run @askjo/[email protected] postinstall { code: null, signal: 'SIGINT' }

The bug

hermes_cli/main.py:_update_node_dependencies() ran:

result = _run_npm_install_deterministic(
    npm,
    path,
    extra_args=("--silent", "--no-fund", "--no-audit", "--progress=false"),
)

_run_npm_install_deterministic() defaults to capture_output=True. Combined with --silent, npm produces zero output until the install completes — even when it is sitting inside a multi-minute postinstall download. From the user's perspective, the process is frozen, and Ctrl-C can leave node_modules partially installed.

The fix

For the repo-root and ui-tui npm installs, drop --silent and pass capture_output=False so npm streams its info run … postinstall lines straight to the terminal as they happen. The _UpdateOutputStream wrapper installed earlier in cmd_update mirrors stdout/stderr to ~/.hermes/logs/update.log, so SSH-disconnect safety is preserved and nothing is lost from the log.

The web/ install path (build step) is intentionally untouched — it is short and does not run binary-fetching postinstalls, so the existing --silent keeps the update output tidy.

This is an output-visibility fix only — no install behavior changes, no flag like --ignore-scripts is introduced. Camofox still bootstraps automatically; users just see what it is doing.

Test plan

  • Focused regression test: tests/hermes_cli/test_cmd_update.py::test_update_refreshes_repo_and_tui_node_dependencies updated to assert (a) --silent removed from repo-root + ui-tui flags and (b) those calls run with capture_output=False. Web install assertion preserved.
  • Adjacent suite: tests/hermes_cli/test_cmd_update.py, tests/hermes_cli/test_web_ui_build.py, tests/hermes_cli/test_tui_npm_install.py — 25/25 pass on rebased origin/main (5d3be898a).
  • Regression guard: with the production change reverted (hermes_cli/main.py only), the focused test fails with the expected flag mismatch; restoring the change makes it pass.

Related

  • Fixes #18840

Changed files

  • hermes_cli/main.py (modified, +9/-2)
  • tests/hermes_cli/test_cmd_update.py (modified, +26/-4)

Code Example

Updating Node.js dependencies...

---

npx camoufox-js fetch || true

---

hermes update

---

Updating Hermes Agent...

Fetching updates...
Found 159 new commit(s)
Pre-update snapshot: 20260502-013852-pre-update
Pulling updates...
Cleared 20 stale __pycache__ directories
Updating Python dependencies...
Updating Node.js dependencies...

---

hermes_cli/main.py:_update_node_dependencies
hermes_cli/main.py:_run_npm_install_deterministic
subprocess.run(...).communicate(...)

---

info run @askjo/camofox-browser@1.5.2 postinstall node_modules/@askjo/camofox-browser npx camoufox-js fetch || true
info run agent-browser@0.26.0 postinstall node_modules/agent-browser node scripts/postinstall.js
info run agent-browser@0.26.0 postinstall { code: 0, signal: null }
info run @askjo/camofox-browser@1.5.2 postinstall { code: null, signal: 'SIGINT' }

---

cd ~/.hermes/hermes-agent
npx camoufox-js fetch

---

extra_args=("--silent", "--no-fund", "--no-audit", "--progress=false")

---

OS: Linux 6.17.0-22-generic
node: v22.22.2
npm: 10.9.7
npm registry: https://registry.npmjs.org/
proxy: null
https-proxy: null

---

{
  "@askjo/camofox-browser": "^1.5.2",
  "agent-browser": "^0.26.0"
}

---

npm ci --dry-run --ignore-scripts --no-fund --no-audit --progress=false

---

cd ~/.hermes/hermes-agent
npm ci --ignore-scripts --no-fund --no-audit --progress=false
npm ci --ignore-scripts --no-fund --no-audit --progress=false --prefix ui-tui
hermes doctor

---

cd ~/.hermes/hermes-agent
npx camoufox-js fetch
RAW_BUFFERClick to expand / collapse

Bug Description

hermes update can appear to hang indefinitely at:

→ Updating Node.js dependencies...

The updater is not actually stuck in git or Python dependency installation. It is waiting on the repo-root npm install, specifically an npm postinstall script from @askjo/camofox-browser:

npx camoufox-js fetch || true

Because the updater runs npm with output captured/suppressed and no timeout, there is no visible progress, download status, or indication that a browser binary fetch is happening. From the user's perspective, the update is frozen until they press Ctrl-C.

Steps to Reproduce

  1. Have Hermes installed from the git checkout.
  2. Run:
hermes update
  1. Observe output similar to:
⚕ Updating Hermes Agent...

→ Fetching updates...
→ Found 159 new commit(s)
  ✓ Pre-update snapshot: 20260502-013852-pre-update
→ Pulling updates...
  ✓ Cleared 20 stale __pycache__ directories
→ Updating Python dependencies...
→ Updating Node.js dependencies...
  1. The process appears to hang. Pressing Ctrl-C shows it was waiting inside _run_npm_install_deterministic() / subprocess.run() during npm install.

Actual Behavior

hermes update silently waits during Node dependency installation. The raw traceback after Ctrl-C points at:

hermes_cli/main.py:_update_node_dependencies
hermes_cli/main.py:_run_npm_install_deterministic
subprocess.run(...).communicate(...)

The npm debug log shows npm was running the Camofox postinstall when interrupted:

info run @askjo/[email protected] postinstall node_modules/@askjo/camofox-browser npx camoufox-js fetch || true
info run [email protected] postinstall node_modules/agent-browser node scripts/postinstall.js
info run [email protected] postinstall { code: 0, signal: null }
info run @askjo/[email protected] postinstall { code: null, signal: 'SIGINT' }

After interruption, node_modules can be left partially installed/corrupted, e.g. npm ls --depth=0 reports invalid/extraneous packages and package directories may exist without package.json.

Expected Behavior

hermes update should not appear to hang silently during optional browser asset downloads.

Reasonable fixes could include one or more of:

  • Run the updater's repo-root npm install with --ignore-scripts, then print a note explaining that optional Camofox browser assets can be fetched manually with:
cd ~/.hermes/hermes-agent
npx camoufox-js fetch
  • Do not pass --silent for this install, or stream npm output so users can see the current postinstall/download step.
  • Add a timeout around npm install/postinstall and print actionable diagnostics if it expires.
  • Split optional browser binary fetching out of hermes update entirely.

My preference: hermes update should default to npm ci --ignore-scripts --no-fund --no-audit --progress=false for the root package. Downloading optional browser binaries should be an explicit/visible setup step, not a silent side effect of the CLI updater.

Investigation Details

The relevant code path currently calls _run_npm_install_deterministic() from _update_node_dependencies() with:

extra_args=("--silent", "--no-fund", "--no-audit", "--progress=false")

Since package-lock.json exists, _run_npm_install_deterministic() starts with npm ci.

Environment where observed:

OS: Linux 6.17.0-22-generic
node: v22.22.2
npm: 10.9.7
npm registry: https://registry.npmjs.org/
proxy: null
https-proxy: null

Root package.json Node dependencies:

{
  "@askjo/camofox-browser": "^1.5.2",
  "agent-browser": "^0.26.0"
}

A non-mutating check succeeded, suggesting the lockfile itself was not the problem:

npm ci --dry-run --ignore-scripts --no-fund --no-audit --progress=false

Workaround

To recover locally after interruption:

cd ~/.hermes/hermes-agent
npm ci --ignore-scripts --no-fund --no-audit --progress=false
npm ci --ignore-scripts --no-fund --no-audit --progress=false --prefix ui-tui
hermes doctor

If Camofox itself is needed later, fetch it separately and visibly:

cd ~/.hermes/hermes-agent
npx camoufox-js fetch

extent analysis

TL;DR

Run hermes update with npm ci --ignore-scripts to prevent silent hanging during optional browser asset downloads.

Guidance

  • Modify the _run_npm_install_deterministic() function to use npm ci --ignore-scripts instead of npm ci to skip postinstall scripts.
  • Consider adding a timeout around npm install/postinstall and print actionable diagnostics if it expires.
  • Stream npm output to display the current postinstall/download step, providing visibility into the update process.
  • Split optional browser binary fetching out of hermes update entirely, making it an explicit setup step.

Example

extra_args = ("--ignore-scripts", "--no-fund", "--no-audit", "--progress=false")

can be used in _run_npm_install_deterministic() to skip postinstall scripts.

Notes

The provided workaround can be used to recover locally after interruption, but a permanent fix should be implemented to prevent silent hanging during updates.

Recommendation

Apply the workaround by running hermes update with npm ci --ignore-scripts to prevent silent hanging, and consider implementing a permanent fix to split optional browser binary fetching out of hermes update.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix hermes update appears stuck at Node.js dependencies during Camofox postinstall [2 pull requests, 1 participants]