fix(browser_tool.py): use AGENT_BROWSER_ARGS for sandbox bypass - #31136
Closed
tsella wants to merge 1 commit into
Closed
fix(browser_tool.py): use AGENT_BROWSER_ARGS for sandbox bypass#31136tsella wants to merge 1 commit into
tsella wants to merge 1 commit into
Conversation
The auto-detection logic for --no-sandbox injection was setting the wrong environment variable. agent-browser v0.26.0 reads AGENT_BROWSER_ARGS (comma-separated), not AGENT_BROWSER_CHROME_FLAGS. When running on systems with AppArmor unprivileged userns restrictions (e.g. Ubuntu 23.10+), this caused Chromium to crash with "No usable sandbox!" even though the code detected the restriction correctly. - Rename env var: AGENT_BROWSER_CHROME_FLAGS → AGENT_BROWSER_ARGS - Adjust flag format: space-separated → comma-separated - Add comment clarifying the agent-browser env var contract Fixes silent --no-sandbox bypass failure on AppArmor-restricted Linux.
Collaborator
|
Duplicate of #25988 (merged) which already landed the same AGENT_BROWSER_CHROME_FLAGS → AGENT_BROWSER_ARGS rename fix. The fix is on main — |
Author
|
Superseded by upstream fix in 0.14.0 — the upstream now handles --no-sandbox and --disable-dev-shm-usage via AGENT_BROWSER_ARGS/AGENT_BROWSER_CHROME_FLAGS properly. Closing. |
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.
Problem
The auto-detection logic that injects
--no-sandboxon AppArmor-restricted systems (Ubuntu 23.10+) sets the wrong environment variable.agent-browserv0.26.0 readsAGENT_BROWSER_ARGS(comma-separated), but Hermes was settingAGENT_BROWSER_CHROME_FLAGSwhich agent-browser ignores entirely.Impact
/proc/sys/kernel/apparmor_restrict_unprivileged_userns == 1Changes
AGENT_BROWSER_CHROME_FLAGS→AGENT_BROWSER_ARGSVerification
Tested on Ubuntu 24.04 with AppArmor userns restrictions enabled. Before fix:
browser_navigatefails with sandbox error. After fix: succeeds and returns snapshot.Fixes silent --no-sandbox bypass failure on AppArmor-restricted Linux.