Add Browser Env Integration#732
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* use remote sandbox env for cua mode * update tests * remote cua in sandbox * Fm/browser add binary (#4) * binary * update * fix non binary execution * fix ruff * update default flags
…ky/verifiers into fm/add-browser-env
| } | ||
|
|
||
| # Thread-safe locks (shared) | ||
| self._thread_lock = threading.Lock() |
There was a problem hiding this comment.
Redundant threading lock in async-only context
Low Severity
_thread_lock (a threading.Lock) wraps an asyncio.Lock in _get_http_client, which is an async method that will only be called from async contexts. The threading lock is unnecessary since the async lock already provides sufficient protection for concurrent coroutines. Additionally, holding a synchronous lock while awaiting an async lock is an anti-pattern that can cause blocking issues.
Additional Locations (1)
|
@willccbb wanna take a look? everything for dom should be good to go idk how to get ty check to pass tho? checked merged prs and they pass with warnings but this one fails with warnings |
| browserbaseProjectId?: string; | ||
| viewport?: Viewport; | ||
| proxies?: boolean; | ||
| } |
There was a problem hiding this comment.
CUA mode silently ignores advanced_stealth parameter
Medium Severity
The advanced_stealth parameter is accepted by BrowserEnv and CUAMode in Python, which includes it in session_config as browserSettings.advancedStealth. However, the TypeScript CUA server's SessionCreateRequest type doesn't define browserSettings, and sessionManager.ts constructs browserSettings with only viewport, ignoring any advancedStealth setting. Users enabling advanced_stealth=True in CUA mode expect Browserbase's anti-bot detection mode, but it has no effect. DOM mode correctly handles this parameter.
Additional Locations (1)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
|
|
||
| def load_environment( | ||
| project_id: str, |
There was a problem hiding this comment.
DOM example requires project_id but documentation omits it
High Severity
The load_environment function requires project_id: str as a mandatory positional argument with no default value. However, the README shows usage without passing this argument (prime eval run browser-dom-example -m gpt-4.1-mini ...), and the docstring example shows env = load_environment() with no arguments. Running the example as documented will raise a TypeError. The CUA example correctly uses optional parameters with defaults, but the DOM example is inconsistent.
Additional Locations (1)
| "proxies": proxies, | ||
| "browserSettings": {"advancedStealth": advanced_stealth} | ||
| if advanced_stealth | ||
| else None, |
There was a problem hiding this comment.
CUA mode advanced_stealth parameter is silently ignored
Medium Severity
When advanced_stealth=True is passed to BrowserEnv in CUA mode, the Python code sends browserSettings: {"advancedStealth": true} in the session config. However, the TypeScript CUA server's SessionCreateRequest interface doesn't include browserSettings, and sessionManager.ts constructs its own browserSettings object containing only viewport settings. The advancedStealth setting is silently discarded, so users expecting anti-bot detection will not have it enabled.


Description
Adds
BrowserEnv- a unified browser automation integration for the verifiers library supporting two operational modes:DOM Mode (
mode="dom")navigate,observe,act,extract- Stagehand's AI-driven primitivesCUA Mode (
mode="cua")click,double_click,type_text,keypress,scroll,goto,back,forward,wait,screenshotdeepdream19/cua-server:latestfor ~5-10s startupBoth modes support local browser execution or Browserbase cloud infrastructure.
What's included:
verifiers/envs/integrations/browser_env/- Core integration (BrowserEnv, DOMMode, CUAMode, CUASandboxMode)assets/templates/browserbase/cua/- TypeScript CUA server with Docker build/runtime configsenvironments/browser_dom_example/- Minimal DOM mode exampleenvironments/browser_cua_example/- Minimal CUA mode example[browser]extra:uv add 'verifiers[browser]'Benchmarks (GAIA, WebVoyager, Mind2Web) have been pushed to Prime Hub under the
browserbase/namespace.Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
CUA Server Deployment Options:
use_prebuilt_image=falseuse_sandbox=falseFuture work:
browserbase/org