fix(install): stop auto-detecting a system browser; always install bundled Chromium - #50852
Merged
teknium1 merged 2 commits intoJun 23, 2026
Merged
Conversation
xxxigm
force-pushed
the
fix/install-drop-system-browser-fallback
branch
2 times, most recently
from
June 22, 2026 14:38
7ffa5bd to
6f3cf66
Compare
…verride
The installer scanned PATH/well-known locations for a Chrome/Chromium binary
and, when found, skipped the bundled Playwright Chromium download and wrote that
path into ~/.hermes/.env as AGENT_BROWSER_EXECUTABLE_PATH. On Snap-based systems
`command -v chromium` resolves to /snap/bin/chromium, whose sandbox blocks
agent-browser's control socket under /tmp -- so every browser_navigate hung
until the 60s timeout fired ("opening web page failed").
Drop the system-browser fallback entirely (per maintainer direction):
find_system_browser()/Find-SystemBrowser now honor ONLY an explicit, user-set
AGENT_BROWSER_EXECUTABLE_PATH override -- no PATH scan, no well-known-path scan.
A /snap/* path is rejected even when set explicitly, since its confinement is
the bug. Applied to both install.sh (Linux/macOS) and install.ps1 (Windows).
Crucially, also auto-repair already-affected installs: the bad snap path
persists in .env and is read directly by the runtime, and the installer skips
re-config when AGENT_BROWSER_EXECUTABLE_PATH is already set ("already
configured"), so a plain reinstall/update never recovered an existing user. New
strip_snap_browser_override() removes a snap-pointing AGENT_BROWSER_EXECUTABLE_PATH
(and its auto-written comment) from .env on every install/update, run from both
browser-setup paths (install_node_deps and ensure_browser), so updating is
enough to recover. A deliberately-set non-snap override is left untouched.
docker/stage2-hook.sh is intentionally untouched: it discovers the bundled
Playwright Chromium, not a system browser.
…epair Replace the old "skips download when a system browser exists" assertions with tests for the new behavior: - no PATH scan for browser command names, and the "use the system browser" path is gone; - find_system_browser consults only an explicit AGENT_BROWSER_EXECUTABLE_PATH override (which still skips the bundled download); - strip_snap_browser_override runs on both install paths and a /snap/* path is rejected, so already-affected installs auto-recover on update.
xxxigm
force-pushed
the
fix/install-drop-system-browser-fallback
branch
from
June 22, 2026 14:46
6f3cf66 to
a7d3c08
Compare
xxxigm
marked this pull request as draft
June 22, 2026 14:56
xxxigm
marked this pull request as ready for review
June 22, 2026 14:57
pnascimento9596
added a commit
to pnascimento9596/hermes-agent
that referenced
this pull request
Aug 5, 2026
…aths source cleanly configure_browser_env_from_system_browser writes the browser override as AGENT_BROWSER_EXECUTABLE_PATH=$browser_path with no surrounding quotes. Post-NousResearch#50852 this path is opt-in only: it runs when the user has exported AGENT_BROWSER_EXECUTABLE_PATH explicitly. When that override contains a space (macOS /Applications/Google Chrome.app/Contents/MacOS/Google Chrome, Windows C:\Program Files\...), the written line is invalid under POSIX shell source: the shell parses the first word after the space as a command, emits "no such file or directory", and leaves the var empty. install.ps1 has the same bug at both writer sites. The Hermes runtime is unaffected (it loads .env via python-dotenv, which parses the unquoted value), but anyone who sources ~/.hermes/.env from a shell — which override users are especially likely to do — gets a stderr error and a silently-empty var. Fix: wrap the value in double quotes at all four writer sites (install.sh + install.ps1). Generalize the strip_snap_browser_override regexes from '^AGENT_BROWSER_EXECUTABLE_PATH=/snap/' to '="?/snap/' so the Snap-stripper still fires on the new quoted form — without this the migration silently no-ops on a quoted snap path, a regression the naive one-line fix would introduce. Update the test assertion pinning the old regex and add behavioral tests that write a spaced path and re-source the .env under both bash and POSIX sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported in Discord (LikiusInik): "hermes desktop: opening web page failed" — every
browser_navigatehangs ~60s and fails.Root cause (confirmed in https://discord.com/channels/1053877538025386074/1518581111008268389): the installer auto-detects a system browser. On a Snap-based Linux box,
find_system_browserrunscommand -v chromium, which resolves to/snap/bin/chromium. Snap's sandbox blocks agent-browser's control socket under/tmp, so the browser tool times out on first use. The installer also (a) skips the bundled Playwright Chromium download and (b) writesAGENT_BROWSER_EXECUTABLE_PATH=/snap/bin/chromiuminto~/.hermes/.env. Re-running the installer never recovers — the Snap binary is still detected and the download stays skipped, which is exactly why commenting the.envline + re-running did nothing for the reporter.Fix
Drop the system-browser fallback entirely. Every install now uses the bundled Playwright Chromium, so the browser tool behaves identically across hosts.
find_system_browser()(install.sh) andFind-SystemBrowser(install.ps1) now honor only an explicit, user-setAGENT_BROWSER_EXECUTABLE_PATH. No PATH scan, no macOS.appscan, no Windows well-known-path scan.AGENT_BROWSER_EXECUTABLE_PATHstill skips the bundled download (explicit override, not a fallback)..envwording accordingly.Tests
tests/test_install_sh_browser_install.pyupdated to assert the new behavior:test_install_script_does_not_autodetect_system_browser_on_path— the PATH-scan command list is gone; download is only skipped for an explicit override.test_install_script_honors_explicit_browser_override—find_system_browserconsults only the override env var.Affected user workaround (pre-merge)
Infographic