Skip to content

feat(agents): the Browser Use agent runs browser-use 1.0.3 - #659

Merged
earakely-scale merged 2 commits into
mainfrom
edgararakelyan/browser-use-1.0
Nov 13, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
edgararakelyan/browser-use-1.0

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What

The agents bundle's Browser Use agent (browser-use) now runs browser-use 1.0 instead of Browser Use Pi, pinned to browser-use==1.0.3, the latest release.

browser-use 1.0 is the Python library rewritten so its agent writes Python in one persistent REPL, straight on CDP. Its release benchmarks it against Browser Use Pi at the same quality, cheaper and faster.

How

  • An environment of its own. browser-use 1.0.3 pins every dependency exactly, including mcp==2.3.0, and the protocol's agent extra needs mcp<2. So the image installs it in /opt/browser-use. The A2A server runs agent.py there once per turn, as it ran node agent.mjs.
  • The model:
    • A Claude model goes through the endpoint's Anthropic Messages route, as browser-use runs Claude. browser-use then sends its reasoning as adaptive thinking at the turn's effort (medium when unset, browser-use's default) and caches the prompt.
    • The Pydantic AI profile comes from the bare model name. Under a LiteLLM name such as anthropic/claude-haiku-5-5, Pydantic AI doesn't know the model supports adaptive thinking and effort. It would send budget thinking, which Haiku 5.5 refuses.
    • Any other model goes through the OpenAI-compatible route, with effort as reasoning_effort.
  • The browser is the task's cdp-config/v1 endpoint, through Browser(cdp_url=...). When the browser has one tab open, as a browser computer does, the agent drives that tab, which is the computer's screen, as Browser Use Pi did. With several, browser-use opens a tab of its own.
  • Why the agent attaches to the browser's tab: browser-use's daemon closes the tab it opened for itself when it stops. Without the attach, Online-Mind2Web's last frame was a blank tab, and the agent's last page was out of reach after the turn. The agent attaches the way browser-use attaches a kept-alive run's tab (Browser._agent_tab, _attach_agent_tab).
  • MCP tools are listed per turn and offered as Pydantic AI tools named <server>__<tool>. They get browser-use's own retry budget, so a tool error goes back to the model.
  • Across turns: a context's later turns continue browser-use's own history through a saved file. This sets Agent._history, _compacted and _continue, as add_new_task does in process; there's no public API for it across processes. It's tied to the pinned 1.0.3, and the integration test's second turn covers it.
  • Telemetry is off: ANONYMIZED_TELEMETRY=false and BH_TELEMETRY=0, in the image and on every turn.
  • Usage: the turn's usage reports browser-use's tokens (cached ones counted in input), plus its requests, cache reads and writes, and its cost when it knows the price. Browser Use Pi reported zeros.

Behavior that changes for this agent

  • effort takes low, medium or high, browser-use's values. Pi's minimal and xhigh are refused.
  • New mode setting (default or ultrafast).
  • max_steps unset is browser-use's 100, not 40.
  • A run that reaches max_steps or its timeout gets browser-use's forced delivery turn, and completes with that answer.
  • The agent still drives the browser's one open tab, as before.
  • The trajectory is the run's Pydantic AI messages, browser-use-messages/1, given when the turn ends, so it's no longer live.

Verification

  • Unit tests: tst/unit/agents/browser_use passes (9). It covers the turn the agent passes, telemetry off, usage, the trajectory, the refused effort, a crash, a timeout and the CDP refusals.
  • Smoke task on a real model: agent-env run agents --task browser-use-smoke --model anthropic/claude-haiku-5-5 passes against a fresh store, in 8.8 s. The trajectory shows the Anthropic route with a prompt-cache write, then a read.
  • Captured request: I pointed the endpoint at a local server that records requests, and ran the smoke task again. browser-use 1.0.3 sent Haiku 5.5 thinking: {type: adaptive, display: summarized}, output_config: {effort: medium}, max_tokens: 128000 and cache control. That's the same effort and thinking Claude Code 2.1.322 sends by default.
  • Integration test: tst/integration/cli/run_bundle_browser_use_test.py is rewritten for the python and finish tools. It passes locally (2 passed, 6 min):
    • the smoke task's shape;
    • the agent reading the title of the browser's own tab;
    • connecting by http_url;
    • a second turn that carries the first one's history;
    • the forged credential refused over both ws and http;
    • the no-browser refusal.
  • Online-Mind2Web: three of its tasks ran clean on the cdp arm (Apple, Trader Joe's, Target). Their exports show the agent's steps and end on the agent's page. The benchmarks exporter now drops tab bookkeeping no one saw (earakely-scale/agentenv-benchmarks@36b0719).
  • Runtime-dependency check: tst/unit/test_runtime_dependencies_are_imported.py now counts the agent folders as container-only, as it counts the gateway, since their images install their own requirements.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

Fix MCP image results and satisfy the named-number requirement before merging.

Fix All in CursorFindings

  1. P1 MCP images become text ▶
  2. P2 Tab deadline lacks a name ▶
Fix with agent prompt
### Issue 1
src/agent_env/agents/agents/browser-use/agent.py:83-87
`_caller` turns MCP images into JSON text. When a task supplies an image-returning tool such as `computer_screenshot`, the model receives base64 text instead of an image it can inspect. The previous bridge preserved image parts. Return images through Pydantic AI's image support rather than joining every part into a string.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
src/agent_env/agents/agents/browser-use/agent.py:98
The new tab lookup embeds its five-second deadline as `timeout=5`. The repository requires magic numbers to have descriptive names. Give this deadline a named setting so readers can find and tune it. This requirement must be satisfied before merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Replaces Browser Use Pi with browser-use==1.0.3 in a private Python environment.

  • The Browser Use agent runs browser-use 1.0.3 in Python.
  • The agent keeps working in the task’s browser and carries its conversation across turns.
  • Agent settings and turn results now follow browser-use’s run model.

Intentional changes stated by earakely-scale: narrower effort values, a new mode setting, the upstream step default, forced delivery, and non-live trajectories. These were not treated as defects.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[A2A turn] --> S[a2a_server.py]
    S --> P[agent.py in private Python environment]
    H[Saved message history] --> P
    P --> M{Model name}
    M --> C[Anthropic Messages]
    M --> O[OpenAI-compatible endpoint]
    P --> B[Task browser through CDP]
    P --> T[Task MCP tools]
    P --> H
    P --> R[Answer, usage, and messages]
    R --> S
Loading

Reviews (1) · Last reviewed commit: "fix(agents): browser-use drives the brow..." · Reviewed by Greptile

browser-use 1.0 replaces Browser Use Pi: the agent now runs browser-use's Python library, pinned to
1.0.3, in an environment of its own in the image, since it pins mcp 2 and the protocol's agent extra
needs mcp 1. A Claude model goes through the endpoint's Anthropic Messages route, as browser-use
runs Claude, with the profile of its bare name, so its adaptive thinking and effort apply; any other
model goes through the OpenAI-compatible route. Telemetry is off, the turn's usage reports
browser-use's tokens, and its trajectory is the run's messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@socket-security

socket-security Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​browser-use@​1.0.383100100100100

View full report

…ys when the turn ends

browser-use's daemon closes the tab it opened for itself when it stops, so a run in it left the
screen blank and its last page out of reach. When the browser has one tab open, as a browser
computer does, the agent attaches to it, as browser-use attaches a kept-alive run's tab. Agent
folders count as container-only for the runtime-dependency check, since their images install
their own requirements; the integration test reads the title of the tab the agent drives, and
browser-use's cell output as it gives it, a list of lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 13, 2026 06:59
@earakely-scale
earakely-scale requested a review from a team as a code owner November 13, 2026 06:59
@earakely-scale
earakely-scale merged commit db0103d into main Nov 13, 2026
33 of 34 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/browser-use-1.0 branch November 13, 2026 06:59
Comment on lines +83 to +87
text = "\n".join(getattr(part, "text", None) or json.dumps(part.model_dump(mode="json"))
for part in result.content)
if result.isError:
raise ModelRetry(text)
return text

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 MCP images become text

_caller turns MCP images into JSON text. When a task supplies an image-returning tool such as computer_screenshot, the model receives base64 text instead of an image it can inspect. The previous bridge preserved image parts. Return images through Pydantic AI's image support rather than joining every part into a string.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/agents/agents/browser-use/agent.py
Line: 83-87

Comment:
**MCP images become text**

`_caller` turns MCP images into JSON text. When a task supplies an image-returning tool such as `computer_screenshot`, the model receives base64 text instead of an image it can inspect. The previous bridge preserved image parts. Return images through Pydantic AI's image support rather than joining every part into a string.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Claude Code Fix in Codex

await browser.start()

def attach() -> None:
own = _daemon_request(browser.name, {"meta": "current_tab"}, timeout=5)["targetId"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tab deadline lacks a name

The new tab lookup embeds its five-second deadline as timeout=5. The repository requires magic numbers to have descriptive names. Give this deadline a named setting so readers can find and tune it. This requirement must be satisfied before merging.

Rule Used: Store magic numbers as class or instance variables with descriptive names rather than using them inline in the code. (source)

Learned From
scaleapi/scaleapi#126388

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/agents/agents/browser-use/agent.py
Line: 98

Comment:
**Tab deadline lacks a name**

The new tab lookup embeds its five-second deadline as `timeout=5`. The repository requires magic numbers to have descriptive names. Give this deadline a named setting so readers can find and tune it. This requirement must be satisfied before merging.

**Rule Used:** Store magic numbers as class or instance variables with descriptive names rather than using them inline in the code. ([source](https://app.greptile.com/-/switch-tenant?tenant=scale-ai&next=%2Fcustom-context%3Fmemory%3D002e0051-41ad-46c1-9098-47433c580150))

**Learned From**
[scaleapi/scaleapi#126388](https://github.com/scaleapi/scaleapi/pull/126388)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Claude Code Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant