Skip to content

fix(images): use the built-in browser tools in Hermes named profiles - #84

Open
derekhsu wants to merge 2 commits into
feat/image-only-clifrom
issue/83-hermes-tools-profile-browser
Open

derekhsu wants to merge 2 commits into
feat/image-only-clifrom
issue/83-hermes-tools-profile-browser

Conversation

@derekhsu

Copy link
Copy Markdown
Owner

Summary

A named Hermes profile created with hermes profile create has no config.yaml. Hermes reads browser.backend from the profile's own YAML without merging DEFAULT_CONFIG, so the tools image (tools.2, tools.3) gave such a profile an empty value. Because uvx is on PATH, Hermes then switched to the Browser Use CLI, which runs uvx browser-use and fetches an unpinned package from PyPI. The tools image now makes a missing browser.backend read as off, so named profiles use the built-in browser tools and the image's Chromium.

Related Issue

Closes #83

Changes

  • agents/hermes-01x/configure-tools-browser.py: takes a third argument, the Hermes source directory, and makes two exact one-line edits:

    • tools/browser_use_cli.py: get_browser_backend() reads a missing browser.backend as off (BACKEND_DISABLED).
    • hermes_cli/config_defaults.py: the DEFAULT_CONFIG browser.backend default becomes off, so code that merges the defaults (load_config_readonly(), the profile-policy probe) also reads off. The web backend default is unchanged.

    Each edit fails if its line is missing or already changed. The script checks every file before it writes any. A profile that sets browser.backend itself keeps its value.

  • agents/hermes-01x/Dockerfile.tools:

    • Before the script runs, sha256sum -c pins both source files to their hashes in BASE_IMAGE. A new base image must be checked against the edits before the hashes change.
    • After the script, py_compile rewrites the two modules' bytecode.
    • The build creates a named profile with no config.yaml, runs the base image's image-build-probes.py profile-policy on it, and asserts get_browser_backend() == "off". Hermes must also not be in Browser Use CLI mode.
  • tools/openclaw-tools-image/fixtures/run-phase3.sh: new Hermes check hermes_profile_browser. It puts a uvx that records its calls first on PATH and creates a named profile with no config.yaml. Then it requires all of the following:

    • backend off, and Hermes not in Browser Use CLI mode;
    • browser_navigate and browser_snapshot in the browser toolset, and no browser_exec;
    • a local page opened through browser_navigate;
    • no uvx call.
  • test/hermes-tools-browser-config.test.ts: covers both source edits, sources that the script refuses (every file stays unchanged), and the three-argument usage.

  • docs/modification/2026-11-17-hermes-tools-image.md: describes the cause, the fix from tools.4 (not yet published), and the base-update step. Section 6 no longer lists named profiles as an open limitation.

Not changed: the standard Hermes image. NemoClaw managed startup (installHermesManagedPolicy()) is out of scope, as the issue states.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: the change removes a runtime package download path (uvx browser-use from PyPI) for named profiles in the tools image only. It does not widen network, file, or privilege settings. The source edits are bound to pinned hashes and exact lines, so a changed base fails the build. Awaiting maintainer review.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: docs/modification/2026-11-17-hermes-tools-image.md. The review also checked the changed comments, docstring, and test titles in Dockerfile.tools, configure-tools-browser.py, run-phase3.sh, and test/hermes-tools-browser-config.test.ts against the writing rules, and checked the doc's claims against the code. It found no blockers. I applied all seven wording suggestions before the commit. npm run docs does not apply: docs/modification/ is not part of the Fern site.
  • Agent: Claude Code

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run test/hermes-tools-browser-config.test.ts test/hermes-tools-image-release.test.ts: 2 files, 46 tests passed
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Local image evidence (arm64, OrbStack):

  • Dockerfile.tools built. The in-build named-profile profile-policy probe passed.
  • run-fixtures.sh <image> <out> hermes: 30 PASS, 0 failed, including hermes_profile_browser.
  • Negative control: hermes_profile_browser fails on the previous tools image with AssertionError: '', the empty backend.
  • check-tools-start.sh: startup matches the base image.
  • Not run locally: amd64. CI's Images / Hermes Tools Verify covers amd64 and arm64. OpenShell sandbox acceptance happens after tools.4 is published.

🤖 Generated with Claude Code


Signed-off-by: Derek Hsu derekhsu@hotmail.com

A named profile created with `hermes profile create` has no config.yaml.
Hermes reads browser.backend from the profile's own YAML without merging
DEFAULT_CONFIG, so the value was empty and, with uvx on PATH, Hermes used
the Browser Use CLI, which fetches an unpinned browser-use from PyPI. The
base image's profile-policy probe also failed on such a profile:
('browser.backend', '', 'off').

configure-tools-browser.py now takes the Hermes source directory and makes
two exact one-line edits: a missing browser.backend reads as "off" in
tools/browser_use_cli.py, and the browser.backend default in
hermes_cli/config_defaults.py becomes "off". A profile that sets
browser.backend keeps its value. Dockerfile.tools pins both source files to
their hashes in BASE_IMAGE, rewrites their bytecode, and runs the
profile-policy probe on a new named profile. The new phase 3 fixture
hermes_profile_browser checks the tools a named profile gets, opens a page,
and fails if uvx runs. The standard Hermes image is unchanged.

Closes #83

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Hsu <derekhsu@hotmail.com>
Bring in #86 so the image checks build on the current Debian pins.

Signed-off-by: Derek Hsu <derekhsu@hotmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(images): Hermes tools 映像的具名 profile 仍使用 Browser Use CLI

1 participant