Skill v1.0.0
currentAutomated scan100/100name: browser-tool-failures description: Diagnose and fix browser_navigate / browser_snapshot / browser_click failures in Hermes Agent on Aurora Linux. Use when browser tools fail with "Chrome exited early", "Auto-launch failed", "DevTools URL" errors, "app/com.google.Chrome/x86_64/master not installed", "local browser could not be started", or return empty content. Covers Camofox routing, Flatpak Chrome (session-bus + TMPDIR handshake requirements), and the cicada toolbox Chromium fallback. tags: [browser, debug, aurora, hermes, troubleshooting, devops] metadata: version: "1.0.0"
Browser Tool Failures on Aurora
Quick diagnosis (run in order)
- Test the local Chrome shim:
``bash google-chrome --version 2>&1 ` If you see error: app/com.google.Chrome/x86_64/master not installed, the Flatpak shim at ~/.local/bin/google-chrome is broken (the Chrome Flatpak ref isn't installed even though flatpak` itself is).
- Test Camofox (preferred path):
``bash curl -s -w "%{http_code}\n" -o /dev/null --max-time 3 http://localhost:9377/health ` Should return 200. Server runs as camofox-browser.service (systemd user unit) on **port 9377**, not 9382. Health endpoint at /health, tabs at /tabs`.
- Test Chromium in cicada toolbox (cron jobs run here):
``bash toolbox run --container cicada /usr/bin/chromium-browser --version ` Should return something like Chromium 148.0.7778.96 Built from source for Fedora release 42 (Adams)`.
- Check the active browser routing:
``bash grep -E "CAMOFOX_URL|AGENT_BROWSER_EXECUTABLE_PATH" ~/.hermes/.env ` The browser tool checks in this order (browser_tool.py:3603+`):
AGENT_BROWSER_EXECUTABLE_PATHenv var — explicit binary overrideCAMOFOX_URLenv var — routes through Camofox REST APIshutil.which("google-chrome")thenchromiumthenchromium-browserthenchrome— local binary
Common causes and fixes
Symptom: "Auto-launch failed: Chrome exited early... app/com.google.Chrome/x86_64/master not installed"
Cause: The shim at ~/.local/bin/google-chrome is a 2-line bash script (exec flatpak run com.google.Chrome "$@"). It needs the Chrome Flatpak installed. Without it, the shim silently fails.
Fix options (in order of preference):
- Switch to Camofox (preferred — no Chrome needed):
`` # Add to ~/.hermes/.env CAMOFOX_URL=http://localhost:9377 `` Restart session to take effect (.env is read at session start, not per-turn).
- Install Chrome Flatpak (the original intent of the shim):
``bash flatpak install flathub com.google.Chrome `` ~1GB download. Takes effect immediately.
- Point at the shim explicitly:
AGENT_BROWSER_EXECUTABLE_PATH=~.local/bin/google-chrome— the robust shim resolves Flatpak Chrome on the host and system Chromium insidecicadatoolboxes. Set in~/.hermes/.env(read at session start — a gateway/session restart applies it).
Symptom: browser_exec / agent-browser launches time out ("The local browser could not be started: Command timed out after 120 seconds"), orphaned agent-browser-chrome- trees pile up (THIRD failure mode, post-Chrome-154)
Diagnose in order — two independent causes, both must hold:
- Chrome dies at startup without a session D-Bus. Flatpak Chrome 154+ spawns a settings helper ("cobalt") that hard-requires the D-Bus settings portal even when
--headless=new. Headless launches from cron/daemons (no DISPLAY, no bus) exit rc=1 instantly withSettings portal not found: Cannot autolaunch D-Bus without X11 $DISPLAY. agent-browser then waits forever on a DevToolsActivePort handshake that never comes → 120s timeout. Fix (applied 2026-09-27):~/.local/bin/google-chromeshim exportsDBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/buswhen unset. Verify without Hermes:
``bash env -u DBUS_SESSION_BUS_ADDRESS ~/.local/bin/google-chrome --headless=new --user-data-dir=/tmp/x about:blank --dump-dom # must print <html>, not the D-Bus error ` Any OTHER launch path that spawns flatpak run com.google.Chrome directly (e.g. ~/.hermes/scripts/ensure_chrome_debug.py`) must inject the same env var itself — it bypasses the shim.
- The handshake file is invisible across the sandbox boundary. agent-browser creates its throwaway profile under
$TMPDIR. Hermes sets TMPDIR to~/.hermes/cache/scratch, and the Flatpak sandbox had no grant for that path, so Chrome wroteDevToolsActivePortinto a mount namespace the host could not read — same class of failure as the old private-/tmp bug, new path. Fix (applied 2026-09-27):flatpak override --user --filesystem=/var~.hermes/cache/scratch com.google.Chrome. Verify:
``bash AB=$(ls ~.npm/_npx/*/node_modules/.bin/agent-browser | head -1) env -u DBUS_SESSION_BUS_ADDRESS timeout 40 "$AB" --session smoketest --json open http://127.0.0.1:8499/ # JSON success <40s = healthy "$AB" --session smoketest close ``
Orphan cleanup: every timed-out launch leaks a full Chrome tree (651 were killed 2026-09-27; the pile itself starves later launches). Kill only agent-browser-chrome- trees with the python snippet below — never blanket-kill chrome; Jason's real Chrome (possibly squatting :9222 via the chrome://inspect toggle, see next section) must survive:
python3 -c "import subprocess,os,signal; out=subprocess.run(['ps','-eo','pid,args'],capture_output=True,text=True).stdout; [os.kill(int(l.split()[0]),signal.SIGKILL) for l in out.splitlines() if 'agent-browser-chrome-' in l and 'ps -eo' not in l]"
Symptom: a port-9222 listener that is NOT a working CDP endpoint (the chrome://inspect toggle)
The chrome://inspect → Allow remote debugging toggle in Jason's interactive Chrome sets devtools.remote_debugging.user-enabled: true in Local State and makes that Chrome listen on 9222 without a usable endpoint: /json/version and /json/* return 404, a websocket upgrade with an Origin header gets 403 ("Use --remote-allow-origins"), and without an Origin header it hangs on the modal "Allow remote debugging?" consent dialog. An open TCP port proves nothing — readiness MUST be GET /json/version returning 200 with a Browser field (Hermes' own is_browser_debug_ready in hermes_cli/browser_connect.py does exactly this). ~/.hermes/scripts/ensure_chrome_debug.py was hardened to that check on 2026-09-27; when 9222 is squatted it launches the dedicated profile on an ephemeral port discovered via DevToolsActivePort.
Also: the Flatpak Chrome sandbox has NO ~/.config access, so --user-data-dir=$HOME/.config/google-chrome silently never materializes — dedicated profiles must live under ~/.var/app/com.google.Chrome/config/.
Symptom: browser_exec — "Failed to launch Chrome at /usr/bin/chromium-browser: No such file or directory"
Cause: that path exists only inside the cicada toolbox. The browser-use/agent-browser path reads AGENT_BROWSER_EXECUTABLE_PATH directly and hard-fails on the host — unlike the built-in tools it does NOT fall through to which(). The legacy env value /usr/bin/chromium-browser broke every host-side browser_exec call.
Fix (applied 2026-09-09): ~/.local/bin/google-chrome is now a robust shim (Flatpak Chrome on the host → /usr/bin/chromium-browser fallback in toolboxes; ~/.local/bin/chromium-browser symlinks to it) and the env var points at it. Verify the shim in both environments without restarting anything:
~/.local/bin/google-chrome --version # host → Google Chrome 152~/.local/bin/google-chrome --version && toolbox run --container cicada ~.local/bin/google-chrome --version # toolbox → Chromium 148
Symptom: browser_exec launches TIMEOUT at 120s, orphaned chrome piles up (SECOND failure mode, same root region)
Once the env path was valid, launches still hung: browser 'get' timed out after 120s and ~6 orphaned --user-data-dir=/tmp/agent-browser-chrome-<uuid> chrome trees accumulated. Root cause: Flatpak Chrome runs with a PRIVATE /tmp. It writes DevToolsActivePort to /run/user/1000/.flatpak/com.google.Chrome/tmp/agent-browser-chrome-<uuid>/, while host-side agent-browser polls the host /tmp/agent-browser-chrome-<uuid>/ — the handshake file is never visible, so every launch times out and (older agent-browser versions) leak the chrome process.
Fix: flatpak override --user --filesystem=/tmp com.google.Chrome — host /tmp is then shared into the sandbox and the handshake lands where agent-browser looks. Persistent (survives reboots); revert with --nofilesystem=/tmp.
Verify without Hermes (agent-browser CLI lives in the npx cache):
AB=~.npm/_npx/*/node_modules/.bin/agent-browsernode $AB --session smoketest --json open http://127.0.0.1:8499/ # JSON <1s = healthy; silence = broken handshakenode $AB --session smoketest close
Clean up orphaned chrome (only agent-browser-chrome- trees — never blanket-kill chrome; the ~/.config/google-chrome one on :9222 is Jason's real-profile connect browser):
python3 -c "import subprocess,os,signal; out=subprocess.run(['ps','-eo','pid,args'],capture_output=True,text=True).stdout; [os.kill(int(l.split()[0]),signal.SIGKILL) for l in out.splitlines() if 'agent-browser-chrome-' in l and 'ps -eo' not in l]"
Note: pkill -f self-matches — if the pattern string appears anywhere else in your command line, pkill kills YOUR shell too (hit live). Use the python form above.
Symptom: Browser works in interactive TUI but cron jobs fail
Cause: Cron jobs run inside the cicada toolbox. The broken google-chrome shim is bind-mounted from the host and fails in the toolbox too. Camofox server (port 9377) IS reachable from inside the toolbox via localhost.
Fix: Make sure CAMOFOX_URL=http://localhost:9377 is in ~/.hermes/.env (the bind-mounted file is the same in both envs). Verify with:
toolbox run --container cicada curl -s -o /dev/null -w "%{http_code}\n" http://localhost:9377/health
Symptom: "userId and sessionKey required" (testing Camofox directly with curl)
Cause: Camofox requires both fields in the POST body when opening a tab. The browser tool auto-generates them — see browser_camofox.py:328 for the format.
Fix for manual testing: Mimic the auto-generation:
USER_ID="hermes_$(python3 -c 'import uuid; print(uuid.uuid4().hex[:10])')"SESSION_KEY="task_smoketest_$(date +%s)"curl -X POST "http://localhost:9377/tabs" \-H "Content-Type: application/json" \-d "{\"userId\":\"$USER_ID\",\"sessionKey\":\"$SESSION_KEY\",\"url\":\"https://example.com\"}"
Symptom: Navigation returns HTTP 500 "Version information not found at ~.cache/camoufox/version.json"
Cause: The Camoufox browser binary was never downloaded. The Node camoufox-js server reads ~/.cache/camoufox/version.json to know the installed browser version; when that file is absent, every tab launch fails with 500. The health endpoint shows {"ok":true,"browserConnected":false,"browserRunning":false} and the server log repeats FileNotFoundError: Version information not found... Please run camoufox fetch to install.
Diagnosis:
curl -s http://localhost:9377/health # browserConnected:false, browserRunning:falsels ~/.cache/camoufox/version.json # missing
Fix (use the Node CLI, NOT the Python `camoufox` CLI):
cd ~camofox-browsernode node_modules/.bin/camoufox-js fetch # downloads the browser + writes version.jsonsystemctl --user restart camofox-browser.servicecurl -s http://localhost:9377/health # should show browserRunning:true
Why the Python CLI doesn't fix it: The camoufox Python package (~/.local/bin/camoufox, v0.5.4) uses a different install marker (.0.5_FLAG + config.json) than the Node camoufox-js server (v0.8.x, which reads version.json). They share ~/.cache/camoufox/ but have incompatible versioning schemes. The error's suggestion to run "camoufox fetch" refers to the Node package's own fetch, not the Python binary. Always run the fetch from inside ~camofox-browser via node node_modules/.bin/camoufox-js fetch.
Camofox cannot execute JavaScript
Symptom: SvelteKit/React/Vue app loads but stays on the SSR-rendered loading screen. browser_snapshot shows minimal content. No console errors visible.
Root cause: The Camofox browser tool renders SSR HTML but does not execute client-side JavaScript. SvelteKit hydration, React hydration, Vue mounting — none of these run. The page appears frozen in its server-rendered state.
This is a tool limitation, not an app bug. Do NOT disable SSR or change app code to work around it.
Verification alternative: Use curl to verify HTML is served and scripts are present:
curl -s http://localhost:PORT/ | grep '<script'curl -s -o /dev/null -w "%http_code}" http://localhost:PORT/
Then have the user test in a real browser (Chrome, Firefox, Safari). This is the only way to verify JS hydration and interactive app functionality.
Fallback chain on Aurora
- Camofox (Firefox with anti-fingerprinting) — active when
CAMOFOX_URLis set. Best for bot-detection-heavy sites. - Chrome 149 Flatpak at
~/.local/bin/google-chrome— only if Chrome Flatpak is installed. - Chromium 148 in
cicadatoolbox at/usr/bin/chromium-browser— only inside the toolbox. - `web_extract` / `curl` — last resort. No JS rendering, no fingerprint evasion.
.env env vars are read at session start, not per-turn. Restart the session after changes.
Key file locations
~/.hermes/.env—CAMOFOX_URLandAGENT_BROWSER_EXECUTABLE_PATHlive here~/.local/bin/google-chrome— robust launcher shim: Flatpak Chrome on the host,/usr/bin/chromium-browserfallback in toolbox containers; harmless once Chrome Flatpak is installed~camofox-browser/server.js— Camofox server source (Node + camoufox-js + playwright-core)~/.config/systemd/user/camofox-browser.service— Camofox systemd unit/var~.hermes/hermes-agent/tools/browser_tool.py:3603+— the routing logic/var~.hermes/hermes-agent/tools/browser_camofox.py:328— auto-generateduserIdformat (hermes_<uuid10>)