fix(browser): use AGENT_BROWSER_ARGS for sandbox bypass (DGX Spark / AppArmor) - #25988
Merged
Conversation
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.
Contributor
🔎 Lint report:
|
This was referenced May 14, 2026
This was referenced May 15, 2026
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.
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, whileAGENT_BROWSER_ARGSis the documented one and is parsed indaemon.jsviasplit(/[,\\n]/). Reported in Discord by Waethorn running on DGX Spark.Salvaged from #24821 (@Jaggia) with a small follow-up.
Changes
tools/browser_tool.py: setAGENT_BROWSER_ARGS=--no-sandbox,--disable-dev-shm-usage(was:AGENT_BROWSER_CHROME_FLAGSwith 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 eitherAGENT_BROWSER_ARGSOR the legacyAGENT_BROWSER_CHROME_FLAGS— so users who already setAGENT_BROWSER_ARGSaren't overwritten..env.example,website/docs/user-guide/features/browser.md,website/docs/reference/environment-variables.md: documentAGENT_BROWSER_ARGSand the auto-injection.scripts/release.py: AUTHOR_MAP foranadi.jaggia@gmail.com → Jaggia.Validation
CHROME_FLAGS(ignored by agent-browser → Chromium dies "No usable sandbox")AGENT_BROWSER_ARGS=--no-sandbox,--disable-dev-shm-usageAGENT_BROWSER_ARGS=--fooCHROME_FLAGSAGENT_BROWSER_CHROME_FLAGSCHROME_FLAGS(ignored)AGENT_BROWSER_ARGSE2E 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