fix(browser): isolate Browser Use Python environment - #84143
Closed
d31tcjg wants to merge 2 commits into
Closed
Conversation
Collaborator
Contributor
Author
|
Confirmed as a duplicate of #83471. Both changes strip |
2 tasks
This was referenced Aug 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.
What does this PR do?
Prevents the bundled Browser Use CLI from inheriting Hermes Desktop Python runtime overrides. Desktop can expose Hermes Python 3.11 site-packages through
PYTHONPATHwhile Browser Use runs in an isolated Python 3.12 uv tool environment; the mixed ABI causesModuleNotFoundError: pydantic_core._pydantic_corebefore Browser Use can start.The fix removes
PYTHONPATHandPYTHONHOMEonly at the Browser Use subprocess boundary, after the existing credential-scrubbed browser environment is built. Browser backend credentials, CDP routing, and workspace helper auto-import remain intact.Related Issue
No existing issue or PR found after searching open and closed work for Browser Use,
PYTHONPATH, andpydantic_core.Type of Change
Changes Made
tools/browser_use_cli.py::_base_subprocess_env()to removePYTHONPATHandPYTHONHOMEbefore launching Browser Use.tests/tools/test_browser_use_cli.pyproving both variables are absent, not merely empty, in the child process.How to Test
PYTHONPATH, launch Browser Use installed as a Python 3.12 uv tool. Before this fix, startup imports Pydantic from the wrong venv and fails inpydantic_core.scripts/run_tests.sh tests/tools/test_browser_use_cli.py tests/tools/test_browser_use_session_expiry.py -q.browser_execto navigate tohttps://example.com, then evaluatedocument.querySelector("h1").textContent.Verified locally:
py_compile, andgit diff --checkpassed.browser_execloaded Example Domain and extracted the expected DOM heading.Checklist
Code
Documentation & Housekeeping
cli-config.yaml.examplechanges are N/A.CONTRIBUTING.md/AGENTS.mdchanges are N/A.subprocess.run.Screenshots / Logs
Live post-restart verification returned: