Skip to content

fix(browser): use AGENT_BROWSER_ARGS for sandbox bypass (DGX Spark / AppArmor) - #25988

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-528b6d1f
May 15, 2026
Merged

fix(browser): use AGENT_BROWSER_ARGS for sandbox bypass (DGX Spark / AppArmor)#25988
teknium1 merged 2 commits into
mainfrom
hermes/hermes-528b6d1f

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Auto-sandbox-bypass now actually fires on Ubuntu 23.10+, DGX Spark, and any AppArmor-restricted system. Hermes was setting AGENT_BROWSER_CHROME_FLAGS, which agent-browser has never read — confirmed empirically: the var appears nowhere in agent-browser's source, while AGENT_BROWSER_ARGS is the documented one and is parsed in daemon.js via split(/[,\\n]/). Reported in Discord by Waethorn running on DGX Spark.

Salvaged from #24821 (@Jaggia) with a small follow-up.

Changes

  • tools/browser_tool.py: set AGENT_BROWSER_ARGS=--no-sandbox,--disable-dev-shm-usage (was: AGENT_BROWSER_CHROME_FLAGS with space-separated value, which agent-browser would have parsed as one bad flag even if it read it). Comma-separated to match the daemon's split regex. [@Jaggia]
  • tools/browser_tool.py: gate now opts out on either AGENT_BROWSER_ARGS OR the legacy AGENT_BROWSER_CHROME_FLAGS — so users who already set AGENT_BROWSER_ARGS aren't overwritten.
  • .env.example, website/docs/user-guide/features/browser.md, website/docs/reference/environment-variables.md: document AGENT_BROWSER_ARGS and the auto-injection.
  • scripts/release.py: AUTHOR_MAP for anadi.jaggia@gmail.com → Jaggia.

Validation

Before After
Clean env, AppArmor=1 injects CHROME_FLAGS (ignored by agent-browser → Chromium dies "No usable sandbox") injects AGENT_BROWSER_ARGS=--no-sandbox,--disable-dev-shm-usage
User pre-set AGENT_BROWSER_ARGS=--foo clobbered with CHROME_FLAGS preserved
User pre-set legacy AGENT_BROWSER_CHROME_FLAGS preserved preserved
Root injects CHROME_FLAGS (ignored) injects AGENT_BROWSER_ARGS

E2E ran on this AppArmor=1 host through the four scenarios above. Browser test slice: 57 passed, 1 pre-existing skip.

Closes #24821 (salvaged). Closes #24930 (alternate, more invasive).

Co-authored-by: Anadi Jaggia anadi.jaggia@gmail.com

Jaggia and others added 2 commits May 14, 2026 16:00
AGENT_BROWSER_CHROME_FLAGS is not read by agent-browser CLI.
The correct env var is AGENT_BROWSER_ARGS, with comma-separated values.

This fixes Chrome 'No usable sandbox' crash on Ubuntu 23.10+ systems
where AppArmor restricts unprivileged user namespaces. The detection
logic was correct but the fix used the wrong environment variable name
and space-separated instead of comma-separated args.
Follow-up to the sandbox-bypass env-var fix:

- Update the opt-out gate so a user-provided AGENT_BROWSER_ARGS is also
  respected, not just the legacy AGENT_BROWSER_CHROME_FLAGS. Previously
  the gate only checked the broken legacy var, so a user who pre-set
  AGENT_BROWSER_ARGS would still get clobbered by Hermes's auto-injection.
- Document AGENT_BROWSER_ARGS in .env.example, the browser feature page,
  and the env var reference, with notes about the auto-injection on
  AppArmor-restricted systems (Ubuntu 23.10+, DGX Spark, containers).
- Add Anadi Jaggia to AUTHOR_MAP.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-528b6d1f vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8374 on HEAD, 8374 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4408 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/browser Browser automation (CDP, Playwright) comp/tools Tool registry, model_tools, toolsets labels May 14, 2026
@teknium1
teknium1 merged commit 4695d27 into main May 15, 2026
18 of 20 checks passed
@teknium1
teknium1 deleted the hermes/hermes-528b6d1f branch May 15, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists tool/browser Browser automation (CDP, Playwright) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants