8209 Commits

Author SHA1 Message Date
Laith Weinberger 510c28ad16 lint 2026-01-24 15:23:24 -05:00
Laith Weinberger 874d90d33d fix css escaping and multi-id aria-controls parsing
use attribute selector instead of id selector to avoid css escaping issues with special chars (e.g. :r1:). parse aria-controls/aria-owns as space-separated list per aria spec.
2026-01-24 15:18:20 -05:00
Laith Weinberger cded687fe6 fix portal dropdown aria-controls resolution
Portal-based dropdowns render options in a separate container via aria-controls. Resolve aria-controls/aria-owns to find options outside the trigger element's descendants.
2026-01-24 15:05:49 -05:00
Magnus Müller 527fc93a03 4096-token prompts for Opus/Haiku 4.5 (#3924)
Use separate system prompts for Opus 4.5 and Haiku 4.5 that are at least
4096 tokens (which is the token minimum for both models' input caching),
enabling input caching and notably reducing cost.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enable input caching for Claude Opus 4.5 and Haiku 4.5 by switching to
dedicated 4096+ token system prompts. This lowers cost and improves
performance for these models.

- **New Features**
- Detect Opus/Haiku 4.5 variants and load long system prompts (standard,
flash, no-thinking).
- Add 4096+ token templates: system_prompt_anthropic.md,
system_prompt_anthropic_flash.md,
system_prompt_anthropic_no_thinking.md.
  - Pass model_name to SystemPrompt to drive correct template selection.

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 18:10:17 -08:00
Magnus Müller 6b23672c3c Merge branch 'main' into cache-anthropic 2026-01-23 18:10:11 -08:00
Magnus Müller 116eb349cb increase char limit for extraction (#3923)
Resolves [#3557](https://github.com/browser-use/browser-use/issues/3557)
and similar issues. extract_clean_markdown() does extract DOM elements
not visible; its extraction was just being overly truncated.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Increased the extraction character limit from 30,000 to 100,000 to
prevent valid content from being cut off during markdown extraction.
Resolves #3557 by allowing full page content (including non-visible DOM
elements) to be returned without premature truncation.

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

<!-- End of auto-generated description by cubic. -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Increase extraction capacity**
> 
> - Bumps `MAX_CHAR_LIMIT` in `extract()` (in
`browser_use/tools/service.py`) from `30000` to `100000` to allow larger
page content to be processed without truncation.
> 
> *Effect:* fewer cut-offs when extracting long pages; may increase
processing time/token usage.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
80a08a4a03. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-23 18:07:18 -08:00
Magnus Müller 80a08a4a03 Merge branch 'main' into #3557 2026-01-23 18:06:47 -08:00
Saurav Panda 55580b73ac feat: added thinking level for gemini 3 pro (#3925)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds thinking_level support for Gemini 3 (Pro and Flash) with safe
defaults and warnings to prevent misconfiguration.

- **New Features**
- Adds thinking_level for Gemini 3; Pro supports low/high (default low),
Flash supports minimal/low/medium/high (default minimal).
- Uses thinking_level for Gemini 3 and thinking_budget for Gemini
2.5/flash.
- Warns on unsupported configs (budget on 3, level on 2.5); falls back
to low if minimal/medium set on 3 Pro.
- Sets thinking_budget=0 by default for Gemini 2.5/flash when not
provided.

- **Migration**
- For Gemini 3, use thinking_level (Pro: low/high; Flash:
minimal/low/medium/high); stop using thinking_budget.
- For Gemini 2.5/flash, use thinking_budget (0 disable, -1 dynamic, or
token count).

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 15:23:03 -08:00
Saurav Panda b63ae37008 Merge branch 'main' into gemini-add-thinking-level 2026-01-23 15:21:17 -08:00
Saurav Panda a97fa345f8 feat(cli): add ChatBrowserUse support for BROWSER_USE_API_KEY (#3914)
## Summary
- Add `ChatBrowserUse` as the first LLM option in the CLI `run` command
when `BROWSER_USE_API_KEY` is set
- Update error message to mention `BROWSER_USE_API_KEY` as a valid
option

## Problem
The CLI `run` command currently only checks for `OPENAI_API_KEY`,
`ANTHROPIC_API_KEY`, or `GOOGLE_API_KEY`, but the
[documentation](https://docs.browser-use.com/supported-models) shows
that `ChatBrowserUse` with `BROWSER_USE_API_KEY` is a valid and
recommended LLM option for browser automation.

Users who only have `BROWSER_USE_API_KEY` configured get the error:
```
No LLM configured. Set OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY
```

## Solution
Added `ChatBrowserUse` support in `get_llm()` function, checking
`BROWSER_USE_API_KEY` first since it's the optimized model for
browser-use tasks.

## Testing
Tested locally - `browser-use run "go to google.com"` now works with
only `BROWSER_USE_API_KEY` set.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds ChatBrowserUse support to the CLI run command by preferring
BROWSER_USE_API_KEY in get_llm, enabling runs with only that key.
Updates the “No LLM configured” error to include BROWSER_USE_API_KEY.

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 15:21:05 -08:00
Saurav Panda 2774be5cc6 Merge branch 'main' into fix/cli-chatbrowseruse-support 2026-01-23 15:18:19 -08:00
Saurav Panda ac4d958183 Merge branch 'main' into gemini-add-thinking-level 2026-01-23 15:16:18 -08:00
Saurav Panda 89fec05871 revert the example.py 2026-01-23 15:13:52 -08:00
Saurav Panda bb3b1e8cf5 added minimal model for gemini 3 flash 2026-01-23 15:11:13 -08:00
Saurav Panda 041d03a93f feat: updated the thinking budget 2026-01-23 14:42:59 -08:00
Saurav Panda 1671170bf6 set default thinking to 0 for gemini-3 models (#3922)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Set the default thinking_budget to 0 for Gemini 3 models when not
specified, matching the existing behavior for flash/flash-lite. This
prevents unexpected thinking token usage and keeps responses fast.

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 13:47:22 -08:00
Saurav Panda 5b06f4edd9 set default thinking to 0 for gemini-3 models 2026-01-23 13:44:29 -08:00
Laith Weinberger a75fa14d14 increase char limit for extraction 2026-01-23 16:38:38 -05:00
Saurav Panda 18c33bbdc6 Added browser use 2-0 support (#3921)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add support for the bu-2-0 Browser Use model so agents can use the
latest LLM.

- **New Features**
  - Allow bu-2-0 in ChatBrowserUse model validation (replaces bu-1-5).
  - Update examples/simple.py to use bu-2-0.

- **Migration**
  - If you used bu-1-5, switch to bu-2-0.

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 13:37:37 -08:00
Laith Weinberger f85bbb49c8 pass model_name to SystemPrompt 2026-01-23 16:33:28 -05:00
Laith Weinberger 2f24f53900 use longer prompts for opus/haiku 4.5 to allow caching 2026-01-23 16:20:25 -05:00
Saurav Panda f3aad3c145 Added browser use 2-0 support 2026-01-23 13:17:56 -08:00
Saurav Panda 9ce7135073 Added support for new browser use model (#3920)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds support for the new bu-1-5 model in ChatBrowserUse and updates the
simple example to use it. Existing models (bu-latest, bu-1-0) and the
browser-use/* pattern remain supported.

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

<!-- End of auto-generated description by cubic. -->
2026-01-23 12:42:39 -08:00
Saurav Panda 37586c9e9f Added support for new browser use model 2026-01-23 12:39:10 -08:00
BouquetAntoine 1a01e5dff7 feat(cli): add ChatBrowserUse support for BROWSER_USE_API_KEY
The CLI 'run' command now supports BROWSER_USE_API_KEY as an LLM option,
using ChatBrowserUse which is optimized for browser automation tasks.

This aligns the CLI behavior with the documented supported models at
https://docs.browser-use.com/supported-models which shows ChatBrowserUse
as a valid LLM option using BROWSER_USE_API_KEY.

Changes:
- Add ChatBrowserUse as first LLM option in get_llm() when BROWSER_USE_API_KEY is set
- Update error message to mention BROWSER_USE_API_KEY
2026-01-22 17:18:08 +01:00
Gregor Žunič b2228b5321 Browser Use CLI (+ skill) (#3911)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds a fast, persistent CLI for browser automation with a background
session server. Enables quick, multi-step workflows with commands for
navigation, interaction, tabs, screenshots, JavaScript, Python, and
agent tasks.

- **New Features**
- New "browser-use" CLI (aliases: bu, browser) with a session server
over Unix sockets/TCP for low-latency commands.
- Commands: open, state (LLM-style output), click, type, input, scroll,
back, screenshot, switch, close-tab, keys, select, eval, extract;
sessions, close (--all), and server status/stop/logs; JSON output
supported.
- Python execution with a persistent namespace and a browser helper
(goto, click, type, scroll, screenshot, html).
- Agent task runner (requires API key) with interactive API key prompt
and config storage.
- Browser modes: chromium (headed/headless), real Chrome with profiles,
and remote cloud; added CLI docs and Claude Code SKILL.md.

- **Migration**
- CLI entry points updated: use browser-use as the main command; legacy
TUI is now browser-use-tui.
- For remote mode and agent tasks, set BROWSER_USE_API_KEY or add
{"api_key": "..."} to ~/.config/browser-use/config.json.

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

<!-- End of auto-generated description by cubic. -->
0.11.4
2026-01-22 00:01:16 -08:00
Gregor Žunič b6bdc17bcb addresses cubic 2026-01-21 22:17:07 -08:00
Gregor Žunič 67351127a5 prepare for 0.11.4 launch 2026-01-21 22:13:21 -08:00
Gregor Žunič 5fc3a428c7 better remote session management 2026-01-21 22:12:51 -08:00
Gregor Žunič c7c5cae20e remote browser fixes + readme 2026-01-21 21:49:26 -08:00
Gregor Žunič 349d72c220 docs: Auto-close browser when done 2026-01-21 21:22:42 -08:00
Gregor Žunič 08c72f67ba chore: Remove auxiliary planning docs 2026-01-21 21:20:44 -08:00
Gregor Žunič 5e75df3eb0 fix: Clean up Python command output format 2026-01-21 21:16:20 -08:00
Gregor Žunič df01886791 docs: Add cleanup instructions to SKILL.md 2026-01-21 21:12:34 -08:00
Gregor Žunič 4716ae50ce fix: State command now outputs LLM representation, add CLI aliases
- State command outputs same format that browser-use agents see
- Added aliases: bu, browser (all work the same)
- Headed mode now correctly shows browser window
2026-01-19 09:36:20 -08:00
Gregor Žunič 0f9e955276 refactor: Rename CLI from 'bu' to 'browser-use'
- Change main entry point to 'browser-use'
- Move TUI to 'browser-use-tui'
- Add README with human instructions
- Update SKILL.md references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 09:11:39 -08:00
Gregor Žunič c4ffaca6e7 feat: Add fast CLI for browser automation (bu command)
Implements a fast, persistent browser automation CLI per CLI_SPEC.md:

- Fast CLI layer using stdlib only (<50ms startup)
- Session server with Unix socket IPC (TCP on Windows)
- Browser modes: chromium, real, remote
- Commands: open, click, type, input, scroll, back, screenshot,
  state, switch, close-tab, keys, select, eval, extract
- Python execution with persistent namespace (Jupyter-like REPL)
- Agent task execution (requires API key)
- JSON output mode

The CLI maintains browser sessions across commands, enabling complex
multi-step workflows. Includes Claude skill description for AI-assisted
browser automation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 01:05:35 -08:00
Mert Unsal 2822511357 Custom tool registry documentation (#3904)
Update custom tool registry documentation to clarify correct parameter
naming and function signatures.

The previous documentation incorrectly showed `browser: Browser` as an
injectable parameter for custom tools. The agent injects parameters by
name matching, so the correct parameter name is `browser_session:
BrowserSession`. This PR fixes this, recommends async functions, and
adds a "Common Pitfalls" section to guide users.

---
[Slack
Thread](https://browser-use.slack.com/archives/C08TZGLPLER/p1768767006926899?thread_ts=1768767006.926899&cid=C08TZGLPLER)

<a
href="https://cursor.com/background-agent?bcId=bc-a9112a17-72ed-4ef2-acba-8d9873477a89"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-a9112a17-72ed-4ef2-acba-8d9873477a89"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>



<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Clarified custom tool docs to use the correct `browser_session:
BrowserSession` injection and recommend async functions with
`ActionResult`, preventing silent tool failures. Added warnings and a
Common Pitfalls section to make name-based parameter injection clear.

- **Bug Fixes**
- Fixed examples to use `browser_session: BrowserSession` (not `browser:
Browser`), return `ActionResult`, and be `async`.
- Added warnings about name-based injection and a Common Pitfalls
section with wrong/correct examples.
- Updated AGENTS.md and tools docs (add.mdx, basics.mdx) for
consistency.

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

<!-- End of auto-generated description by cubic. -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Clarifies custom tool docs and examples to correctly use
`browser_session: BrowserSession`, `async` functions, and
`ActionResult`, reducing silent failures from name-based injection
mismatches.
> 
> - Update examples in `AGENTS.md`, `docs/customize/tools/basics.mdx`,
and `docs/customize/tools/add.mdx` to replace `browser: Browser` with
`browser_session: BrowserSession`, switch to `async`, and return
`ActionResult`
> - Add prominent warnings about name-based parameter injection and a
new **Common Pitfalls** section with wrong/correct examples
> - Minor note updates to reference deterministic Actor actions via
`browser_session`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1c70a9dbc5. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-18 12:18:22 -08:00
Cursor Agent 1c70a9dbc5 docs: fix custom tool registry documentation to prevent common pitfalls
- Fix basics.mdx: change browser: Browser to browser_session: BrowserSession
- Fix basics.mdx: use async functions and proper ActionResult return type
- Add Warning about parameter name matching in basics.mdx
- Add Warning and Common Pitfalls section in add.mdx with clear examples
- Update AGENTS.md embedded docs to match

The agent injects special parameters by name matching, not by type.
Using incorrect parameter names (e.g., browser instead of browser_session)
causes tools to fail silently, which was a common user confusion.

Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2026-01-18 20:12:46 +00:00
Larsen Cundrič 83d667a023 Improve placeholder handling for 2FA secrets in registry service (#3902)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Generate TOTP codes only when the placeholder key ends with
"bu_2fa_code". This supports multiple 2FA secrets and avoids false
matches in secret replacement.

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

<!-- End of auto-generated description by cubic. -->
2026-01-16 17:21:03 -08:00
LarsenCundric dd8a63ce41 Improve placeholder handling for 2FA secrets in registry service 2026-01-16 17:05:50 -08:00
Saurav Panda a110878f12 fix: updated aiohttp version (#3901)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Updated aiohttp dependency to >=3.13.3 to fix conflicts with internal
libraries and ensure compatibility. Bumped package version to 0.11.3.

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

<!-- End of auto-generated description by cubic. -->
0.11.3
2026-01-16 12:33:50 -08:00
Saurav Panda e1ee8b753f fix: updated aiohttp version 2026-01-16 12:26:30 -08:00
Saurav Panda 728ec50536 Add menu retry for agent rerun if fails (#3891)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds a menu-aware retry to agent reruns: if a menu item can’t be
matched, the agent re-opens the dropdown and retries quickly. This
reduces flaky failures in multi-level dropdown flows.

- **Bug Fixes**
- Detects menu openers (aria-haspopup, toggleSubMenu, expand-button,
role with aria-expanded).
- Detects menu items (menuitem roles, gw-action--inner, menu-related
classes, stable ax_name).
- Re-executes the opener step with a short delay and retries without
consuming a retry attempt.
  - Improves logging and preserves existing backoff behavior.
  - Adds unit tests for opener/item detection.

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

<!-- End of auto-generated description by cubic. -->
2026-01-15 11:36:19 -08:00
Saurav Panda 147db04c1c Merge branch 'main' into add-ax-name-fallback-rerun 2026-01-15 11:03:27 -08:00
Saurav Panda ac118718d0 Added docs for timeout env variables. (#3894)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added an Environment Variables section to the Agent parameters docs that
lists all timeout env vars with defaults and clear descriptions, plus
example usage. This lets users tune agent and browser behavior and
troubleshoot slow networks or complex pages without code changes.

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

<!-- End of auto-generated description by cubic. -->
2026-01-15 11:03:12 -08:00
Saurav Panda 050cea627a make event bus timeout configurable using env (#3893)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Made the Agent event bus stop timeout configurable via the
TIMEOUT_AgentEventBusStop env var (default 3s) to let tests and
deployments tune shutdown wait time. This connects to Linear 3076 by
allowing environments to adjust the idle wait instead of using a fixed
value.

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

<!-- End of auto-generated description by cubic. -->
2026-01-15 11:01:28 -08:00
Saurav Panda b71894b97b fixed parameter name in docs 2026-01-15 10:57:03 -08:00
Saurav Panda 9339935c1f added check for history item state 2026-01-15 10:50:07 -08:00
Saurav Panda 730ae0fda4 Added docs for timeout env variables. 2026-01-15 10:48:08 -08:00