8916 Commits

Author SHA1 Message Date
Saurav Panda 3db36bbc58 Update pyproject.toml (#4495)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Bump the `browser-use` package version from 0.12.2 to 0.12.3 in
`pyproject.toml` to prepare the 0.12.3 release.

<sup>Written for commit 45bff34a18.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.12.3
2026-03-23 15:39:52 -07:00
Saurav Panda 45bff34a18 Update pyproject.toml 2026-03-23 15:35:41 -07:00
Saurav Panda c8f3e8c5d4 add bu benchmark plot and cloud vs oss discussion in readme (#4454) 2026-03-23 12:18:10 -07:00
Saurav Panda 399f154503 Merge branch 'main' into bu-max-readme 2026-03-23 11:50:35 -07:00
Alezander9 9919f2eee6 improve readme plot styling 2026-03-22 15:51:10 -07:00
Alezander9 b70697205f Merge branch 'bu-max-readme' of https://github.com/Alezander9/alex-browser-use into bu-max-readme 2026-03-22 15:47:18 -07:00
Alezander9 d33c31d6a9 improve readme styling 2026-03-22 14:46:31 -07:00
laithrw d9a3065e5e fix open security advisories: restrict workflow permissions, bump vulnerable deps, remove unused authlib (#4468)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Tightens CI workflow permissions and addresses dependency advisories to
reduce risk.

- **Security**
- Set `permissions: contents: read` for `install-script`, `lint`, and
`package` workflows; set `permissions: {}` for `cloud_evals`.

- **Dependencies**
- Removed unused `authlib`; bumped `pypdf` to `6.9.1` and `pillow` to
`12.1.1`.

<sup>Written for commit 3cd7841052.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-22 17:21:37 -04:00
Laith Weinberger 3cd7841052 drop unnecessary contents:read from cloud_evals workflow 2026-03-22 17:14:42 -04:00
Laith Weinberger e539ee7b73 use contents: read instead of empty permissions on CI workflows 2026-03-22 17:10:49 -04:00
Laith Weinberger ef02e59ae0 bump pypdf and pillow 2026-03-22 16:49:41 -04:00
Laith Weinberger 48a227431f remove unused authlib dependency 2026-03-22 16:49:15 -04:00
Laith Weinberger 6f6f08d501 restrict default GITHUB_TOKEN permissions on CI workflows 2026-03-22 16:45:36 -04:00
Saurav Panda 94b3d46fdc Merge branch 'main' into bu-max-readme 2026-03-22 13:09:31 -07:00
laithrw edfd3ec623 fix: extensions broken on Chrome 145+ (MV2 removal + flag changes) (#4466)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes broken extension loading on Chrome 145+ by migrating defaults to
Manifest V3 and removing Chrome flags that block unpacked extensions.
Extensions now load reliably in MV3-only environments.

- **Bug Fixes**
- Stopped passing flags that block extensions on 145+
(`--disable-component-extensions-with-background-pages`,
`--test-type=gpu`).
- Replaced MV2 `uBlock Origin` with MV3 `uBlock Origin Lite`; removed
`ClearURLs` (MV2).
  - Added a manifest check to skip MV2 extensions and log a warning.

<sup>Written for commit 29da480659.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-22 16:00:20 -04:00
Laith Weinberger 29da480659 replace MV2 extensions with MV3 + remove chrome flags that block extension loading 2026-03-22 14:17:56 -04:00
shawn pana 73e11b0bba docs: add browser-use-docs skill with cloud API and open-source .md files (#4450)
New skill providing documentation reference for writing Python code
against the browser-use library and making Cloud REST API calls.
Condensed from CLOUD.md (2700 lines of OpenAPI YAML → 530 lines of
tables) and AGENTS.md (1021 lines → 762 lines with markup stripped and
sections deduplicated).

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds two skills, `open-source` and `cloud`, with focused docs for the
`browser-use` Python library and Cloud APIs/SDKs. Replaces the old
combined docs skill with granular references, a v2/v3 API split with
REST examples, and three integration guides.

- **New Features**
- Split into `skills/open-source/*` (quickstart, models,
agent/browser/tools/actor, integrations/MCP, monitoring, examples) and
`skills/cloud/*` (quickstart/pricing/FAQ, v2 REST and v3 Agent API,
direct CDP browser API, sessions/profiles/1Password, features,
patterns).
- Added guides: chat UI (v3 with `liveUrl`), subagent (Cloud SDK), and
tools integration; removed open‑source imports from cloud guides.
Deleted the old `browser-use-docs` skill. Updated routing for separate
v2/v3 API files.
- Expanded v3 docs with full REST endpoints and polling, plus CDP
discovery and auto‑lifecycle details in the browser API.

- **Bug Fixes**
- v2 file upload now uses multipart POST with presigned form fields;
examples include all returned fields.
- Agent and timing fixes: defaults updated (`max_actions_per_step=5`,
`max_failures=5`, `use_vision=True`, `step_timeout=180`), `llm_timeout`
auto‑detection, `max_steps=500` (was 100), and NavigateToUrl timeout 30s
(was 15s).
- Provider/env fixes and docs polish: correct `ChatVercel`
(`provider_options.gateway`) and `AI_GATEWAY_API_KEY`; use `uv pip
install browser-use-sdk`; add `try/finally` cleanup and guard
`pw.stop()`; define `session.id` before uploads; add missing `await` on
`get_usage_summary()`; distinct MCP server name; fix TOC anchor and
relative link; set full v3 base URL; wrap chat‑ui Python example in
`async def main()` with `asyncio.run()` (removed duplicate sleep).
- Cloud corrections: v3 pricing updated (BU Mini output $4.20, BU Max
$18.00); Selenium `debugger_address` now strips `/devtools/browser/`
suffix; webhooks use `type`/`payload` with 5‑min replay protection and
sorted‑key signature verification.
- Selenium CDP connection examples now handle `wss://` URLs correctly;
webhook examples add a JSON parse guard.

<sup>Written for commit 318eb3b41e.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-21 19:08:15 -07:00
ShawnPana 318eb3b41e fix Selenium wss:// handling and webhook JSON parse guard 2026-03-21 19:04:16 -07:00
ShawnPana 709853c307 fix accuracy issues found by cross-referencing SDK source
Open-source:
- agent.md: max_steps default 100 → 500 (matches agent/service.py)
- agent.md: NavigateToUrlEvent timeout 15.0 → 30.0 (matches events.py)

Cloud:
- quickstart.md: v3 pricing corrected — BU Mini output $2.88 → $4.20,
  BU Max output $14.40 → $18.00 (matches pricing.mdx)
- browser-api.md: Selenium debugger_address now strips /devtools/browser/
  suffix (matches browser-api.mdx)
- features.md: webhook payload uses "type"/"payload" not "event"/"data",
  signature verification now includes 5-min replay protection and sorted
  JSON keys (matches webhooks.mdx)
2026-03-21 18:59:26 -07:00
shawn pana 672d2c92ea Merge branch 'main' into docs/docs-skill 2026-03-21 18:49:36 -07:00
ShawnPana 884f5d20d6 fix chat-ui.md: remove duplicate await asyncio.sleep(2) after asyncio.run() 2026-03-21 18:45:08 -07:00
ShawnPana 00d9a9694f fix chat-ui.md: wrap Python example in async def main() + asyncio.run() 2026-03-21 18:39:55 -07:00
ShawnPana 71e8415764 fix cubic review: TOC anchor, relative link, full v3 base URL
- subagent.md: fix TOC anchor to match renamed heading (#python-agents-cloud-sdk)
- subagent.md: fix relative link to ../features.md from guides/ subdir
- SKILL.md: use full v3 base URL instead of .../api/v3
2026-03-21 18:35:13 -07:00
ShawnPana 74275eff3c split browser-use-docs into separate open-source and cloud skills
Two independent skills so Claude only loads what's relevant:

skills/open-source/ — Python library docs (Agent, Browser, Tools, Actor,
  MCP, monitoring, models, examples). 9 reference files.

skills/cloud/ — Cloud API, SDK, and integration patterns. 7 reference
  files + 3 guides (chat-ui, subagent, tools-integration). Guides edited
  to remove open-source Python imports (Actor API, Tools Registry,
  MCPClient sections removed from tools-integration; local Agent wrapper
  replaced with Cloud SDK in subagent; local-only error/cost patterns
  removed from cross-cutting concerns).

Delete skills/browser-use-docs/ entirely.
2026-03-21 18:29:23 -07:00
ShawnPana 4416cf18c2 add integration guides: chat UI, subagent, tools integration
Three guides organized by agent type (CLI sandbox agents, Python frameworks,
TypeScript, MCP clients, HTTP/workflow engines, existing Playwright/Puppeteer):

- chat-ui.md: Build conversational browser UI with Cloud SDK v3, liveUrl
  iframe embedding, message polling, follow-ups, optimistic updates
- subagent.md: Delegate entire web tasks (black box). CLI cloud passthrough
  for sandbox agents, Python Agent wrapper, Cloud SDK, MCP browser_task,
  REST API for workflow engines. Plus structured output, error handling,
  cost control patterns
- tools-integration.md: Add individual browser actions to existing agent.
  CLI commands for sandbox agents, Actor API (Page/Element/Mouse), Tools
  Registry (execute_action), MCPClient (auto-discovery), CDP+Playwright
  for TypeScript, local MCP server for Claude/Cursor. Decision matrix
  mapping agent type → best integration
2026-03-21 18:16:45 -07:00
Saurav Panda 6bc09a21bf fix: auto-switch to new tabs after click and add checkbox toggle fall… (#4433)
…back

- AGI-569: after any click that opens a new tab, automatically dispatch
SwitchTabEvent so the agent lands on the new page immediately instead of
requiring a manual switch step (~877 occurrences)

- AGI-548: for <input type="checkbox/radio">, capture checked state
before the CDP mouse click and verify it toggled afterward; if unchanged
(custom-styled or shadow-DOM-backed inputs), fall back to JS
element.click() and report the final checked state in metadata (~1,241
occurrences)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Automatically switch to newly opened tabs after clicks and make
checkbox/radio interactions reliable with a JS fallback. Addresses
AGI-569 and AGI-548 to improve navigation flow and form handling.

- **Bug Fixes**
- Auto-switch to new tabs: detect a new tab after a click and dispatch
`SwitchTabEvent`; on failure, add a note to manually switch.
- Checkbox/radio reliability: capture pre-click checked state; if the
CDP click doesn’t toggle, fall back to `element.click()` and include the
final `checked` state in metadata.

<sup>Written for commit 4a65aea6a9.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-21 17:26:22 -07:00
shawn pana a57c34b4b6 Merge branch 'main' into docs/docs-skill 2026-03-21 17:25:11 -07:00
ShawnPana 5ee7104fcc fix 3 remaining cubic review issues
- agent.md: fix llm_timeout docs to match auto-detection logic (Groq 30s,
  Gemini 75s, o3/Claude/DeepSeek 90s, default 75s)
- examples.md: guard pw.stop() with None check to prevent UnboundLocalError
- api-v2.md: show all S3 presigned form fields in upload example
2026-03-21 17:20:42 -07:00
Saurav Panda 4a65aea6a9 Merge branch 'main' into auto-switch-new-tab 2026-03-21 17:17:32 -07:00
Saurav Panda f66dc67553 fix: index elements inside cross-origin iframes reliably (#4452)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Make cross-origin iframe indexing reliable so elements inside them are
included consistently. Handles dynamic iframes and target-attachment
races to prevent missing content during DOM builds.

- **Bug Fixes**
- Fallback to matching iframes by sanitized `src` when `frameId` is
missing or not yet in `all_frames`.
- Use `frameTargetId` directly; fetch details via `get_target()` when
available and fall back to frame metadata if not.
- Remove race in target tracking by creating/updating `Target` inside
the same lock as `_target_sessions`.
- Skip detached targets in `get_all_frames()` by catching `ValueError`,
and wrap iframe DOM recursion in try/except to avoid failing the whole
tree.

<sup>Written for commit 03de83a069.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-21 17:17:08 -07:00
ShawnPana 8dfb3cc882 fix review issues from cubic bot
- models.md: fix ChatVercel provider_options and env var (AI_GATEWAY_API_KEY)
- examples.md: add try/finally for browser cleanup in parallel and playwright examples
- agent.md: fix defaults to match source (max_actions_per_step=5, max_failures=5,
  use_vision=True, llm_timeout=60, step_timeout=180)
- features.md: fix undefined session_id in workspace example
- monitoring.md: add missing await on get_usage_summary()
- api-v2.md: fix upload flow to use multipart POST with fields (S3-style)
- SKILL.md: use uv pip for cloud SDK install
- integrations.md: use distinct MCP server name for docs endpoint
2026-03-21 17:15:18 -07:00
ShawnPana 607c6c814e split cloud API reference into v2 and v3, add REST-first coverage
Replace cloud/api.md with api-v2.md (321 lines, 39 endpoints with cURL
examples) and api-v3.md (257 lines, 16 endpoints with full REST details).

Key improvements:
- cURL examples for all major operations (create task, poll, get session,
  create browser/CDP, upload file, stop session)
- All 15 skills + marketplace endpoints (previously missing)
- Session purge and task status polling endpoints
- v3 REST endpoints (was SDK-only, now has full HTTP paths/params/responses)
- v3 cost fields, polling defaults, stop strategies, file upload flow
- CDP discovery endpoint and auto-lifecycle in browser-api.md
- Updated SKILL.md routing table for v2/v3 split
2026-03-21 17:08:25 -07:00
Alezander9 598bb85cc2 add bu benchmark plot and cloud vs oss discussion in readme 2026-03-21 16:52:10 -07:00
ShawnPana 7c765aaa53 restructure browser-use-docs skill with 15 granular reference files
Replace two monolithic reference files with open-source/ and cloud/ subdirs,
each containing focused reference files that Claude loads on demand.

Open-source (9 files): quickstart, models (15+ providers), agent (params,
hooks, timeouts), browser (params, auth, real/remote), tools (custom,
built-in, ActionResult), actor (Page/Element/Mouse API), integrations
(MCP, skills, docs-mcp), monitoring (Laminar, OpenLIT, costs), examples
(fast agent, parallel, playwright, sensitive data).

Cloud (6 files): quickstart (setup, pricing, FAQ), api (v2 REST + v3 SDK),
sessions (profiles, auth, 1Password, social media), browser-api (CDP direct,
Playwright/Puppeteer/Selenium), features (proxies, webhooks, workspaces,
skills, MCP, live view), patterns (parallel, streaming, geo-scraping,
tutorials).

Content sourced from full SDK docs (89 files) rather than just AGENTS.md
and CLOUD.md.
2026-03-21 16:24:41 -07:00
Saurav Panda 03de83a069 Merge branch 'main' into iframe-click-issue 2026-03-21 15:57:02 -07:00
Saurav Panda 3b8f2457b1 fix: index elements inside cross-origin iframes reliably 2026-03-21 15:54:35 -07:00
ShawnPana 5642d069a3 add browser-use-docs skill with cloud API and open-source library references
New skill providing documentation reference for writing Python code against
the browser-use library and making Cloud REST API calls. Condensed from
CLOUD.md (2700 lines of OpenAPI YAML → 530 lines of tables) and AGENTS.md
(1021 lines → 762 lines with markup stripped and sections deduplicated).
2026-03-21 15:34:12 -07:00
laithrw 987a990623 widen retry timing assertions so CI stops flaking (#4439)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Widen retry backoff timing assertions in `tests/ci/test_llm_retries.py`
to reduce CI flakiness. Upper bounds: first 0.3s, second 0.5s; still
verify exponential growth.

<sup>Written for commit 954cf0f6f7.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-21 02:22:52 -04:00
laithrw 954cf0f6f7 Merge branch 'main' into rm-codeagent 2026-03-21 02:20:49 -04:00
Laith Weinberger 544ad89287 widen retry timing assertions so CI stops flaking 2026-03-21 02:20:17 -04:00
laithrw 54aa7c3ef8 rm code agent (#4438)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Removed the code-use mode and `CodeAgent` to simplify the codebase and
drop heavy optional dependencies. This is a breaking change for projects
using `CodeAgent` or `browser_use.code_use.*`.

- **Migration**
  - Replace `CodeAgent` with `Agent` and adapt to action-based flows.
- Remove imports from `browser_use.code_use.*` and `CodeAgentTools`; use
`Tools` from `browser_use.tools.service`.
- Drop usage of code-use helpers (`create_namespace`, `export_to_ipynb`,
`session_to_python_script`, `CodeCell`, `NotebookSession`, and the
code-use DOM serializer).
- Stop installing the `code` extra; if needed, add `numpy`, `pandas`,
`matplotlib`, and `tabulate` directly to your project.

<sup>Written for commit 43b5e4ce1d.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-21 02:11:33 -04:00
Laith Weinberger 43b5e4ce1d rm code agent 2026-03-21 02:05:42 -04:00
Saurav Panda e7a05cbe86 fix: auto-switch to new tabs after click and add checkbox toggle fallback
- AGI-569: after any click that opens a new tab, automatically dispatch
  SwitchTabEvent so the agent lands on the new page immediately instead
  of requiring a manual switch step (~877 occurrences)

- AGI-548: for <input type="checkbox/radio">, capture checked state
  before the CDP mouse click and verify it toggled afterward; if
  unchanged (custom-styled or shadow-DOM-backed inputs), fall back to
  JS element.click() and report the final checked state in metadata
  (~1,241 occurrences)
2026-03-20 12:43:58 -07:00
Saurav Panda 3220b22f0e huge cli update (#4364)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Rebuilt the CLI around a per‑session daemon and added a stdlib
`browser-use cloud` REST command, Chrome auto‑discovery with
`--connect`, a new `upload` command, and smarter profile resolution
(accepts display names; falls back to raw value when metadata is
missing). Also hardens liveness/ping paths to prevent duplicate daemons,
consolidates files under `~/.browser-use`, and simplifies install/setup.

- **New Features**
- Daemon: single session with socket‑as‑liveness; exits when the browser
dies; guarded signal handler awaits shutdown to avoid orphaned Chrome;
fixed socket FD leaks; `ensure_daemon` returns early on ping failure or
`success:false` to avoid duplicates; clean disconnects for external
browsers (`--connect`, `--cdp-url`, cloud); Windows liveness check via
OpenProcess.
- Cloud: `browser-use cloud` with login/logout, versioned REST (e.g.,
`v2 GET /browsers`, `v2 POST /tasks …`), polling; stdlib‑only (no
daemon). `cloud --help` shows custom usage; `cloud v2 --help` lists
OpenAPI endpoints; REST errors print bodies to stderr.
- Connections and profiles: `--connect` auto‑discovers Chrome via CDP;
`--cdp-url` attaches to running browsers; `--profile` integrates with
managed `profile-use`, accepts directory and display names
(case‑insensitive), shows available profiles on mismatch, and falls back
to the raw value if Chrome metadata can’t be read. `doctor` checks basic
network, `cloudflared`, and `profile-use` with cross‑platform tips. All
CLI files live in `~/.browser-use` (config, sockets, binaries, tunnels).
- File uploads: `browser-use upload <index> <path>` finds nearby inputs
(shared `find_file_input_near_element` on `BrowserSession`); Python REPL
adds `browser.upload(index, path)`; client resolves absolute paths.

- **Migration**
- Removed `run` and agent flags; use `browser-use cloud` for task
execution.
- Removed `--browser remote` and cloud task/session/profile subcommands;
use `browser-use cloud` or the library
(`BrowserSession(use_cloud=True)`).
- Simplified installer/setup: no install modes or API key flags;
`install.sh` just installs, scopes `INSTALL_DIR` so `profile-use`
installs to `~/.browser-use/bin/`, pinned `profile-use` to v1.0.2.
- Paths consolidated to `~/.browser-use`; override with
`BROWSER_USE_HOME` if needed.
- Dropped `portalocker` and old server/locking files; daemon uses socket
presence. `cloud connect` is mutually exclusive with `--profile` and
`--cdp-url`.

<sup>Written for commit a2c2fa33aa.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-20 10:01:28 -07:00
shawn pana a2c2fa33aa Merge branch 'main' into cli 2026-03-20 09:34:45 -07:00
Aitor 51ac1fb9f3 Enhance User-Agent header handling in BrowserSession (#4431)
- Updated the BrowserSession class to ensure the User-Agent header is
set correctly for both local and remote connections.
- Introduced a utility function to retrieve the browser-use version and
incorporated it into the User-Agent string.
- Ensured headers are consistently handled as dictionaries to avoid
potential issues with None values.

This change improves the reliability of the CDP client communication by
providing a proper User-Agent, which can be crucial for certain web
interactions.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Ensure `BrowserSession` always sends a proper User-Agent and preserves
user headers. Injects default `browser-use/<version>` for remote CDP and
`/json/version` requests to improve version discovery and WebSocket
stability.

- **Bug Fixes**
- Inject default `browser-use/<version>` for `/json/version` and remote
CDP; preserve all user headers and any existing User-Agent.
- Normalize headers to dicts; pass `None` only for local when empty;
always include User-Agent for remote, even with no user headers.
- Apply in both connect and reconnect; tests tightened to verify these
cases and updated with a clearer User-Agent assertion.

<sup>Written for commit ad41865559.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-20 08:52:24 +01:00
reformedot ad41865559 Refactor User-Agent assertion in CDP headers test
- Updated the assertion for the User-Agent header in the /json/version endpoint test to improve readability by using a multi-line format.
- This change enhances the clarity of the test's intent while maintaining the existing validation logic.

These modifications contribute to better maintainability of the test code.
2026-03-20 00:47:59 -07:00
reformedot f64f587d09 Enhance header validation in CDP client tests
- Improved assertions in tests to ensure all user-provided headers are present in the additional_headers.
- Added checks to confirm that the User-Agent header is injected for remote connections, ensuring consistent behavior across tests.
- Updated the test for the /json/version endpoint to validate the presence and format of the User-Agent header.

These changes enhance the reliability of header handling in the CDP client tests.
2026-03-20 00:43:15 -07:00
reformedot 2675c52e65 Enhance User-Agent header handling in BrowserSession
- Updated the BrowserSession class to ensure the User-Agent header is set correctly for both local and remote connections.
- Introduced a utility function to retrieve the browser-use version and incorporated it into the User-Agent string.
- Ensured headers are consistently handled as dictionaries to avoid potential issues with None values.

This change improves the reliability of the CDP client communication by providing a proper User-Agent, which can be crucial for certain web interactions.
2026-03-19 23:33:10 -07:00
ShawnPana dbb356d2eb fall back to raw profile value when Chrome metadata can't be read
If list_chrome_profiles() returns empty (permissions, corrupt Local State,
first-run Chrome), skip resolution and use the profile value as-is instead
of always raising RuntimeError.
2026-03-19 23:14:31 -07:00