fix(browser): use correct env var for --no-sandbox bypass

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.
This commit is contained in:
Anadi Jaggia 2026-05-12 21:45:33 -07:00 committed by Teknium
parent 1702a94c88
commit 8ed2ef6f46

View file

@ -1892,8 +1892,8 @@ def _run_browser_command(
except OSError:
pass
if _needs_sandbox_bypass:
browser_env["AGENT_BROWSER_CHROME_FLAGS"] = (
"--no-sandbox --disable-dev-shm-usage"
browser_env["AGENT_BROWSER_ARGS"] = (
"--no-sandbox,--disable-dev-shm-usage"
)
# Use temp files for stdout/stderr instead of pipes.