Conversation
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.
| "gepa", | ||
| "pyzmq>=27.1.0", | ||
| "msgpack>=1.1.2", | ||
| "wandb>=0.25.0", |
There was a problem hiding this comment.
Unrelated wandb dependency added to core package
High Severity
wandb>=0.25.0 is added to the core verifiers package dependencies, but wandb is not imported or used anywhere in the verifiers/ source tree. It is only used in the separate packages/verifiers-rl/ package, which already declares its own wandb dependency. This change is unrelated to the PR description and adds a heavyweight transitive dependency (~hundreds of MB) for all users of the core package.
| content = _get_message_content(msg) | ||
| if isinstance(content, list): | ||
| for content_idx, item in enumerate(content): | ||
| if isinstance(item, dict) and item.get("type") == "image_url": |
There was a problem hiding this comment.
Curl path missing retryable=False for parse errors
Medium Severity
CUASessionCreateError raised in _create_session_curl for a JSON decode error on a successful (HTTP 200) response omits both retryable and status_code, defaulting to retryable=True. The equivalent HTTP path in _create_session_http correctly passes retryable=False and status_code=resp.status. This causes the curl path to wastefully retry on a permanently malformed response.


Description
Two fixes for the BrowserEnv CUA mode and a DX improvement for the DOM example:
Fix screenshot passing in CUA messages: Screenshots attached as
image_urlparts inside tool messages were being dropped by clients. The newenv_responseoverride inBrowserEnvrelocatesimage_urlparts out of tool messages into a trailingUserMessageso they are preserved. Also normalizes empty tool-callargumentsto"{}"to preventjson.loads("")decode failures on zero-arg tools (e.g.screenshot).Make
filter_screenshots_in_messagesrobust to mixed content types: Content parts can be plain dicts or Pydantic objects. Updated type checks inCUAModeto handle bothvia
_get_item_type()helper andgetattrfallback.DX improvement for DOM example: Made
project_idoptional inload_environment()— it now falls back to theBROWSERBASE_PROJECT_IDenv var at runtime. Removed theupfront env-var validation that eagerly errored before the environment was even used.
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Files changed:
environments/browser_dom_example/browser_dom_example.py— makeproject_idoptional, remove eager env-var checkverifiers/envs/integrations/browser_env/browser_env.py— newenv_responseoverride: sanitize empty tool args + relocate screenshots from tool messages to user messagesverifiers/envs/integrations/browser_env/modes/cua_mode.py— handle dict and Pydantic content parts infilter_screenshots_in_messagesNote
Medium Risk
Touches browser/sandbox session lifecycle and retry behavior and changes how screenshots/messages are post-processed, which could affect CUA stability and provider-facing error handling under load.
Overview
Improves
BrowserEnvCUA message handling by normalizing empty zero-arg tool-callargumentsto{}and relocatingimage_urlparts found in tool messages into a trailing user message so screenshots aren’t dropped by downstream adapters.Hardens CUA session creation with a new
CUASessionCreateError, dedicated retry/backoff controls for session creation (separate from other operations), richer error parsing (HTTP status + JSON body), and best-effort cleanup of partially created sandboxes/sessions on setup failure.Updates the CUA Fastify template server to apply session-create backpressure (configurable concurrent/queued limits), classify provider failures into structured
SessionCreateErrorresponses (retryable,statusCode), and documents the new server env vars; also makes the DOM example’sproject_idoptional and addswandbto project dependencies with expanded tests for the new behaviors.Written by Cursor Bugbot for commit a62cc90. This will update automatically on new commits. Configure here.