Skip to content

fix(browser): pass current agent-browser sandbox args - #20014

Closed
EmpireOperating wants to merge 2 commits into
NousResearch:mainfrom
EmpireOperating:fix/browser-agent-browser-args
Closed

fix(browser): pass current agent-browser sandbox args#20014
EmpireOperating wants to merge 2 commits into
NousResearch:mainfrom
EmpireOperating:fix/browser-agent-browser-args

Conversation

@EmpireOperating

Copy link
Copy Markdown
Contributor

Summary

  • pass sandbox bypass flags through AGENT_BROWSER_ARGS, which is what current agent-browser versions read
  • keep AGENT_BROWSER_CHROME_FLAGS as a backward-compatible fallback for older agent-browser builds
  • include Arch Linux in the sandbox-bypass detection path for the observed Chrome early-exit/DevToolsActivePort failure mode
  • add regression coverage for the subprocess environment passed to agent-browser

Test plan

  • .venv/bin/python -m pytest -q tests/tools/test_browser_homebrew_paths.py tests/tools/test_browser_cdp_override.py tests/tools/test_browser_hardening.py
  • git diff --check

Context

origin/main already injects --no-sandbox for root/AppArmor cases, but it currently writes only AGENT_BROWSER_CHROME_FLAGS. Current agent-browser uses AGENT_BROWSER_ARGS, so the injected flags can be silently ignored and local browser startup can fail before DevToolsActivePort is written.

@EmpireOperating
EmpireOperating force-pushed the fix/browser-agent-browser-args branch from 43080cb to 03fc399 Compare May 5, 2026 03:12
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets tool/browser Browser automation (CDP, Playwright) labels May 5, 2026
@EmpireOperating
EmpireOperating force-pushed the fix/browser-agent-browser-args branch from c34f1d0 to a0f2142 Compare May 8, 2026 14:20
@EmpireOperating

Copy link
Copy Markdown
Contributor Author

Rebased this branch onto current main (674fad1) and resolved the browser-tool conflict.

Local validation from the rebased head (a0f2142):

  • git diff --check
  • .venv/bin/python -m py_compile tools/browser_tool.py tests/tools/test_browser_homebrew_paths.py
  • .venv/bin/python -m pytest -q tests/tools/test_browser_homebrew_paths.py tests/tools/test_browser_chromium_check.py -o 'addopts=' → 41 passed

CI notes after the rebase:

  • Passing: attribution, supply-chain scan, e2e, nix ubuntu, nix macos.
  • ruff + ty diff failed while posting the PR comment from a fork (Resource not accessible by integration). The report body showed ruff clean and diagnostics in run_agent.py, not this PR's touched files.
  • The full test job is still red, but the reported failures are outside this PR's changed files (tools/browser_tool.py, tests/tools/test_browser_homebrew_paths.py).

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused diagnosis and regression coverage.

Automated hermes-sweeper review found that the sandbox-bypass behavior targeted here is already implemented on current main:

  • tools/browser_tool.py:2405-2416 now injects AGENT_BROWSER_ARGS=--no-sandbox,--disable-dev-shm-usage when the root/Docker/AppArmor bypass predicate applies.
  • Commit 8ed2ef6f46e9642acfba57b4b8da893a574ecfd0 made the AGENT_BROWSER_CHROME_FLAGS → comma-separated AGENT_BROWSER_ARGS correction.
  • Commit 4695d2716f60da89152bdc9dfa7d96e54ea7c22e added the pre-set AGENT_BROWSER_ARGS guard and documentation.
  • The fix shipped in v2026.5.16.

The linked competing-PR discussion also identifies this as the same env-var fix. Closing as implemented on main.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 12, 2026
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 sweeper:implemented-on-main Sweeper: behavior already present on current main 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