Skip to content

fix(doctor): detect agent-browser in the Hermes-managed node bin (#53192) - #53205

Closed
AgenticSpark wants to merge 1 commit into
NousResearch:mainfrom
AgenticSpark:agenticspark/doctor-detect-managed-agent-browser
Closed

fix(doctor): detect agent-browser in the Hermes-managed node bin (#53192)#53205
AgenticSpark wants to merge 1 commit into
NousResearch:mainfrom
AgenticSpark:agenticspark/doctor-detect-managed-agent-browser

Conversation

@AgenticSpark

Copy link
Copy Markdown

What does this PR do?

hermes acp --setup-browser --yes installs agent-browser into the Hermes-managed
node prefix at ~/.hermes/node/bin/agent-browser, which isn't necessarily on PATH.
hermes doctor only checked PROJECT_ROOT/node_modules and PATH (shutil.which),
so it reported agent-browser not installed (run: npm install) even though the binary
was present and runnable — a discovery false negative, not an install failure (#53192).

This mirrors the detection hermes_cli/dep_ensure.py::_has_hermes_agent_browser()
already does, so doctor and dep_ensure agree on what "installed" means.

Related Issue

Fixes #53192

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/doctor.py: in the Node.js + agent-browser check, look for the binary in
    HERMES_HOME/node/bin/agent-browser and the legacy HERMES_HOME/node_modules/.bin/agent-browser
    before warning, each gated by agent_browser_runnable() (the same dangling-symlink guard
    the existing PATH branch uses). PATH, node_modules, and Termux behavior are unchanged.
  • tests/hermes_cli/test_doctor.py: added a positive case (managed bin present and runnable →
    detected, no warning) and a negative case (present but not runnable → still warns).

How to Test

  1. With node installed and agent-browser only at ~/.hermes/node/bin/agent-browser (not on PATH,
    no node_modules/agent-browser), run hermes doctor — it now reports agent-browser OK instead of
    "not installed".
  2. pytest tests/hermes_cli/test_doctor.py -q → all green (66 passed).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix
  • I've run pytest tests/hermes_cli/test_doctor.py -q and all tests pass
  • I've added tests for my changes
  • I've tested on my platform: Ubuntu 24.04

Documentation & Housekeeping

  • I've updated relevant documentation — N/A (behavior-only fix)
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md — N/A
  • I've considered cross-platform impact — the new paths match the non-Windows branch of
    dep_ensure._has_hermes_agent_browser(); the existing Windows .cmd handling there is unchanged
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

…etup-browser installs aren't reported as missing (NousResearch#53192)

`hermes acp --setup-browser` installs agent-browser into the Hermes-managed
node prefix (~/.hermes/node/bin/agent-browser), which isn't necessarily on
PATH. doctor only checked PROJECT_ROOT/node_modules and PATH (shutil.which),
so it false-negatived with "agent-browser not installed" even though the
binary was present and runnable. Mirror dep_ensure._has_hermes_agent_browser()
by also checking HERMES_HOME/node/bin and the legacy
HERMES_HOME/node_modules/.bin path, each gated by agent_browser_runnable().

Tested with tests/hermes_cli/test_doctor.py (added positive + not-runnable
cases) and pytest tests/hermes_cli/test_doctor.py -q (66 passed).
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 26, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing a real current-main diagnostic gap: hermes_cli/doctor.py:1556-1580 still checks only the project install and PATH, while ACP setup routes through ensure_dependency("browser") (acp_adapter/entry.py:189-211) and the POSIX installer places the executable at $HERMES_HOME/node/bin/agent-browser (scripts/install.sh:2479-2503).

Problems

  • The new candidates omit the Windows managed layout. scripts/install.ps1:363-371 installs under $HERMES_HOME/node, and scripts/install.ps1:389-395 invokes $HERMES_HOME/node/agent-browser.cmd. The proposed POSIX-only candidates would leave hermes doctor false-negative on that installation. hermes_cli/dep_ensure.py:60-70 already distinguishes this .cmd location.

Suggested changes

  • Add and validate the Windows .cmd managed candidate, and cover it with a doctor regression test.

Automated hermes-sweeper review.

Comment thread hermes_cli/doctor.py
# `hermes acp --setup-browser` installs agent-browser into the
# Hermes-managed node prefix, which isn't necessarily on PATH. Mirror
# dep_ensure._has_hermes_agent_browser() so doctor and dep_ensure agree
# on what "installed" means; otherwise doctor false-negatives (#53192).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds only the POSIX prefix layout. scripts/install.ps1:389-395 installs and invokes the managed Windows shim at HERMES_HOME/node/agent-browser.cmd; add that platform-specific candidate (also through agent_browser_runnable) or Windows hermes doctor will retain the same false negative.

@teknium1 teknium1 added sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users area/install-update Installer, updater, packaging, wheels, doctor labels Jul 15, 2026
teknium1 added a commit that referenced this pull request Jul 29, 2026
Follow-up on the #53205 salvage: replace bare is_file() probes of the
managed (~/.hermes/node[/bin]) and legacy (node_modules/.bin) locations
with shutil.which(..., path=dir) so Windows resolves the executable
.cmd shim instead of the extensionless POSIX script — the same miss
class fixed for _has_agent_browser() in #73932. Also covers the
Windows managed layout where the binary sits in node/ directly.
@teknium1

Copy link
Copy Markdown
Contributor

Landed on main via #73959 — your commit was cherry-picked with authorship preserved (f170113 → rebase-merged at c892ca2), plus a follow-up widening the managed/legacy dir probes to PATHEXT-aware shutil.which resolution so the Windows .cmd shim is found too (same class fix as #73932). Thanks @AgenticSpark for the diagnosis, fix, and regression tests!

@teknium1 teknium1 closed this Jul 29, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Follow-up on the NousResearch#53205 salvage: replace bare is_file() probes of the
managed (~/.hermes/node[/bin]) and legacy (node_modules/.bin) locations
with shutil.which(..., path=dir) so Windows resolves the executable
.cmd shim instead of the extensionless POSIX script — the same miss
class fixed for _has_agent_browser() in NousResearch#73932. Also covers the
Windows managed layout where the binary sits in node/ directly.
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
Follow-up on the NousResearch#53205 salvage: replace bare is_file() probes of the
managed (~/.hermes/node[/bin]) and legacy (node_modules/.bin) locations
with shutil.which(..., path=dir) so Windows resolves the executable
.cmd shim instead of the extensionless POSIX script — the same miss
class fixed for _has_agent_browser() in NousResearch#73932. Also covers the
Windows managed layout where the binary sits in node/ directly.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
Follow-up on the NousResearch#53205 salvage: replace bare is_file() probes of the
managed (~/.hermes/node[/bin]) and legacy (node_modules/.bin) locations
with shutil.which(..., path=dir) so Windows resolves the executable
.cmd shim instead of the extensionless POSIX script — the same miss
class fixed for _has_agent_browser() in NousResearch#73932. Also covers the
Windows managed layout where the binary sits in node/ directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes acp --setup-browser succeeds, but hermes doctor still reports agent-browser not installed

3 participants