Commit Graph

8176 Commits

Author SHA1 Message Date
Mert Unsal ba95838647 faster scroll (#3732) 2025-12-07 23:24:59 -08:00
mertunsall 2e3aed3045 faster scroll 2025-12-07 23:17:24 -08:00
EnzoFanAccount 7bae4e09c0 support multi-tab recording 2025-12-06 23:06:19 -03:00
Gregor Žunič 71d529d14d simple browser use integration 2025-12-05 16:46:36 -08:00
Gregor Žunič 4707bef5e3 added skills with pydantic validation 2025-12-05 15:46:33 -08:00
Saurav Panda b02ff053ec AI: add ai_step to replace extract_content on rerun (#3696)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added an analysis step for reruns that replaces extract replay,
generating fresh results from filtered page markdown and optional
screenshot. Rerun now routes extract actions through this step and
supports a dedicated LLM.

- **New Features**
- Added _execute_ai_step with system/user prompts, clean markdown
extraction, optional screenshot, and LLM invocation with timeout.
- rerun_history accepts ai_step_llm; extract actions are re-evaluated
via the analysis step, while other actions run in batch with order
preserved.
  - New prompts: get_ai_step_system_prompt and get_ai_step_user_prompt.
- Updated example to show custom LLM usage for the analysis step and
summary.
- Added tests (basic extraction, screenshot handling, error path) in
tests/ci/test_ai_step.py.

<sup>Written for commit 00866bd885.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-12-04 01:39:04 -08:00
Saurav Panda 00866bd885 Merge branch 'main' into add-ai-step-for-extraction 2025-12-04 00:34:31 -08:00
Magnus Müller 6bd8faa53e Check agent urls in docs (#3714)
Convert all shortcut and relative URLs to full URLs in `AGENTS.md` for
consistency and robustness.

---
[Slack
Thread](https://browser-use.slack.com/archives/C08SZRT860M/p1764777500203789?thread_ts=1764777500.203789&cid=C08SZRT860M)

<a
href="https://cursor.com/background-agent?bcId=bc-d05fbe93-a8fa-4df6-bacf-38d9aae8db3d"><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-d05fbe93-a8fa-4df6-bacf-38d9aae8db3d"><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
Replaced all relative and shortcut links in AGENTS.md with full absolute
URLs to ensure links work reliably across GitHub and the docs site.
Prevents broken or ambiguous links, improving doc consistency.

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

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
a7498839ac. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-12-03 10:52:28 -08:00
Magnus Müller a7498839ac Merge branch 'main' into cursor/check-agent-urls-in-docs-claude-4.5-opus-high-8510 2025-12-03 10:52:17 -08:00
Saurav Panda a4e77e2070 Merge branch 'main' into add-ai-step-for-extraction 2025-12-03 09:14:26 -08:00
Saurav Panda 1011e3e661 feat: added fallback llm support (#3712)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds fallback LLM support to keep the agent running when the primary
model hits rate limits or provider errors. Also standardizes HTTP error
handling to custom exceptions used by the agent.

- **New Features**
- Agent accepts a fallback_llm and switches on 401, 402, 429, 500, 502,
503, 504 after primary retries are exhausted.
- Fallback stays active for the rest of the run and is registered with
token cost tracking.
  - New properties: is_using_fallback_llm and current_llm_model.
- Added example and docs for configuring and observing fallback
behavior.

- **Refactors**
- ChatBrowserUse now raises ModelProviderError and ModelRateLimitError
(instead of ValueError) for HTTP failures.
  - Updated tests to cover fallback switching and new exception types.

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

<!-- End of auto-generated description by cubic. -->
2025-12-03 09:13:40 -08:00
Saurav Panda cad2216410 Merge branch 'main' into add-model-fallback 2025-12-03 08:40:13 -08:00
Cursor Agent ffe8e223fc Fix: Update documentation links to use absolute paths
Co-authored-by: mamagnus00 <mamagnus00@gmail.com>
2025-12-03 15:59:25 +00:00
Magnus Müller dcb5711b13 fix the supported model broken link (#3711)
ref: #3710 


cc: @mertunsall @MagMueller 

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixed the broken “Supported Models” link in AGENTS.md by pointing to the
correct docs URL. This ensures readers can access the models list
without 404s.

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

<!-- End of auto-generated description by cubic. -->
2025-12-03 07:57:25 -08:00
Saurav Panda 885a3dbb38 Merge branch 'main' into add-model-fallback 2025-12-03 05:59:03 -08:00
Saurav Panda d0e181216e feat: added fallback llm support 2025-12-03 18:53:29 +05:30
Naymul Islam a26832d730 fix the supported model broken link
Signed-off-by: Naymul Islam <naymul504@gmail.com>
2025-12-03 18:46:35 +06:00
Mert Unsal 3f7cee1f05 Bugfix to #3702 (#3703)
Closes #3702

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes Agent.logger to be safe during initialization and when IDs are
missing, preventing crashes and malformed log names. Closes #3702.

- **Bug Fixes**
- Use getattr to safely read task_id and browser_session; slice IDs only
when present.
- Fallback to '----' for missing task/session IDs and '--' for missing
target ID.
- Precompute ID fragments to avoid repeated attribute access and slicing
errors.

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

<!-- End of auto-generated description by cubic. -->
2025-12-02 21:38:44 -08:00
Alex Mascolo ef03559d51 Bugfix to #3702 2025-12-02 17:00:46 -08:00
Mert Unsal 35a66a4f6c fix example (#3699)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Update `examples/features/judge_trace.py` to instantiate
`ChatBrowserUse()` without an explicit `base_url`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3ffd26fbe0. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Update judge_trace example to initialize ChatBrowserUse() without a
hardcoded localhost base_url. This makes the example work out of the box
with default settings and avoids connection errors when no local server
is running.

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

<!-- End of auto-generated description by cubic. -->
2025-12-02 00:12:02 -08:00
mertunsall 3ffd26fbe0 fix example 2025-12-02 00:10:54 -08:00
Saurav Panda 7d2c6dc79e AI: add ai_step to replace extract_content on rerun 2025-12-01 21:34:09 +05:30
Mert Unsal 0126a7a7ee get rid of force (#3695)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Drops the `force` parameter from `ClickElementAction` and always
dispatches coordinate clicks with `force=True`.
> 
> - **Click actions**:
> - Remove `force` field from `ClickElementAction` in
`browser_use/tools/views.py`.
> - In `browser_use/tools/service.py`, `_click_by_coordinate` now always
dispatches `ClickCoordinateEvent` with `force=True` and no longer reads
from params.
> - **Types/API**:
> - Updates action input model and event dispatch to align with the
removal of `force`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
aa0d1fb00f. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Removed the force flag from ClickElementAction and made coordinate
clicks always forced. This simplifies the API and makes click behavior
consistent.

- **Migration**
- Remove the force field from ClickElementAction payloads; it is no
longer supported.
- Adjust any logic that relied on optional safety gating for coordinate
clicks.

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

<!-- End of auto-generated description by cubic. -->
2025-11-30 11:51:42 -08:00
mertunsall aa0d1fb00f get rid of force 2025-11-30 11:46:48 -08:00
Mert Unsal f6f5bbdc11 change mistral model (#3693)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Switched the Mistral example to mistral-small-2506 with temperature 0.6
for faster, more varied outputs.

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

<!-- End of auto-generated description by cubic. -->
2025-11-29 14:43:46 -08:00
Mert Unsal b25480ec81 Delete examples/test_bu.py 2025-11-29 14:43:23 -08:00
mertunsall 64ddfd9a62 change mistral model 2025-11-29 14:42:47 -08:00
Mert Unsal 281b7a1bd4 Add Mistral chat provider with schema sanitization and presets (#3679)
Description:

add ChatMistral with max_tokens/safe_prompt handling, env overrides,
provider tagging, and improved error parsing
introduce MistralSchemaOptimizer to strip unsupported JSON schema
keywords (minLength, maxLength, pattern, format) for structured outputs
wire Mistral exports and presets (mistral_large/medium/small, codestral,
pixtral_large) into browser_use and llm modules
document Mistral support and include runnable example
examples/models/mistral.py
add unit test verifying banned schema keywords are removed















<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a Mistral chat provider with safe JSON schema sanitization for
structured outputs, plus model presets, docs, and an example to make
Mistral easy to use in browser_use.

- **New Features**
- ChatMistral with max_tokens, optional safe_prompt, env overrides
(MISTRAL_API_KEY, MISTRAL_BASE_URL), provider tag, and clearer
error/rate-limit handling.
- MistralSchemaOptimizer removes unsupported schema keywords (minLength,
maxLength, pattern, format).
- Model presets and aliases: mistral_large/medium/small, codestral,
pixtral_large; wired into exports and get_llm_by_name.
  - Updated README and a runnable example (examples/models/mistral.py).
  - Unit test validates banned schema keywords are stripped.

- **Migration**
  - Set MISTRAL_API_KEY (optional MISTRAL_BASE_URL).
- Use ChatMistral or presets via get_llm_by_name (e.g.,
"mistral_medium"); structured outputs work automatically.

<sup>Written for commit 38b3bb2edd.
Summary will update automatically on new commits.</sup>

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















<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces `ChatMistral` with schema sanitization, env-configured
client, model presets/aliases, docs, example, and tests, wired into lazy
imports and model factory.
> 
> - **LLM / Mistral**:
> - Add `ChatMistral` (`browser_use/llm/mistral/chat.py`): supports
`max_tokens`, optional `safe_prompt`, env
`MISTRAL_API_KEY`/`MISTRAL_BASE_URL`, improved error parsing, usage
reporting, and OpenAI-style message serialization.
> - Add `MistralSchemaOptimizer` (`browser_use/llm/mistral/schema.py`)
to strip unsupported JSON Schema keywords (`minLength`, `maxLength`,
`pattern`, `format`) for structured outputs.
> - Wire into exports and lazy imports: `browser_use/__init__.py`,
`browser_use/llm/__init__.py`.
> - Extend model factory (`browser_use/llm/models.py`): handle
`mistral_*` provider and top-level aliases
(`mistral_large/medium/small`, `codestral`, `pixtral_large`); update
`__all__`.
> - Tests: add `browser_use/llm/tests/test_mistral_schema.py` to verify
keyword stripping.
> - Docs/Example: update `browser_use/llm/README.md` with Mistral
specifics; add runnable example `examples/models/mistral.py`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
38b3bb2edd. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-29 14:41:53 -08:00
Mert Unsal 38b3bb2edd Merge branch 'main' into feature/mistral-support 2025-11-29 14:30:08 -08:00
Mert Unsal 6f403e5f32 Add cloud (#3692) 2025-11-29 14:23:03 -08:00
mertunsall fce911140e Add cloud 2025-11-29 14:22:44 -08:00
Mert Unsal 67ea744ca0 Bump dependency to 0.10.1 (#3691)
Bump version to 0.10.1.

---
[Slack
Thread](https://browser-use.slack.com/archives/D092QUQDC56/p1764454050532729?thread_ts=1764454050.532729&cid=D092QUQDC56)

<a
href="https://cursor.com/background-agent?bcId=bc-9b5469ea-517f-44fa-b792-b757fbfcc330"><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-9b5469ea-517f-44fa-b792-b757fbfcc330"><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
Bump package version from 0.10.0 to 0.10.1 to prepare the next patch
release. Updates pyproject.toml so the published distribution reflects
the new version.

<sup>Written for commit 7f4f5cacbc.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.10.1
2025-11-29 14:09:28 -08:00
Cursor Agent 7f4f5cacbc Bump version to 0.10.1 2025-11-29 22:08:07 +00:00
Mert Unsal 340d1c9ef0 Bump pyproject to 0.10.0 (#3690)
Bump `pyproject.toml` version to 0.10.0.

---
[Slack
Thread](https://browser-use.slack.com/archives/D092QUQDC56/p1764453583572869?thread_ts=1764453583.572869&cid=D092QUQDC56)

<a
href="https://cursor.com/background-agent?bcId=bc-4cfc135f-4d82-45da-bfc7-21b66b344b0c"><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-4cfc135f-4d82-45da-bfc7-21b66b344b0c"><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
Bump package version from 0.9.7 to 0.10.0 in pyproject.toml to prepare
the 0.10.0 release. Ensures consistent versioning across builds and
publishing.

<sup>Written for commit 879960a16a.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-29 14:05:39 -08:00
Cursor Agent 879960a16a Bump version to 0.10.0 2025-11-29 22:00:16 +00:00
Mert Unsal d90546a094 Update agent name in documentation (#3689)
Update "ClaudeS" to "Claude Code" as requested by the user.

---
[Slack
Thread](https://browser-use.slack.com/archives/D092QUQDC56/p1764452537589129?thread_ts=1764452537.589129&cid=D092QUQDC56)

<a
href="https://cursor.com/background-agent?bcId=bc-c4c7ed7e-1935-46dd-bf0c-471d51aa0e5a"><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-c4c7ed7e-1935-46dd-bf0c-471d51aa0e5a"><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
Updated the README LLM Quickstart to rename “ClaudeS” to “Claude Code”
so the instructions reference the correct agent name. This removes an
outdated reference and prevents confusion during setup.

<sup>Written for commit 63292a26b5.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.10.0
2025-11-29 13:58:42 -08:00
Cursor Agent 63292a26b5 Fix: Update Claude Code in README
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-29 21:43:12 +00:00
Mert Unsal c1062cf45e Fix Regressions (#3688)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes typing and screenshot regressions to make interactions more
reliable. Adds a small delay between keystrokes, focuses the page before
screenshots, and clarifies text input usage.

- **Bug Fixes**
- Add 10ms delay between keystrokes in typing handlers to prevent missed
characters.
- Focus the target page when creating the CDP session for screenshots to
avoid incorrect captures.
- Clarify input action: only index-based text input; never use
coordinates.

<sup>Written for commit 0db058e41b.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-29 13:40:52 -08:00
Mert Unsal a299f83e57 Merge branch 'main' into mert/trytofixmain 2025-11-29 13:40:44 -08:00
Mert Unsal aba135a887 docs(sandbox): fix async sandbox example by adding asyncio.run and import asyncio (#3677)
**Description:**
This PR updates the Sandbox Quickstart example to make it fully runnable
when
copied into a standalone script.

**Changes:**
- Added `import asyncio`
- Wrapped the async sandbox entrypoint in:
  ```python
  if __name__ == "__main__":
      asyncio.run(production_task())
  ```
- Prevents the “coroutine was never awaited” runtime error.

**Issue:**
No related issue (minor documentation fix).

**Dependencies:**
None.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixed the async Sandbox Quickstart example so it runs as a standalone
script without errors. Added import asyncio and a __main__ guard that
calls asyncio.run(production_task()), preventing the “coroutine was
never awaited” runtime error.

<sup>Written for commit 7fd4a38a2b.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2025-11-29 13:18:27 -08:00
Mert Unsal 2da9da6e83 Add provider options to ChatVercel for enhanced model routing (#3685)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added provider options to ChatVercel to control Vercel AI Gateway
routing and fallback order. Also improved handling for Anthropic models
and updated docs and examples.

- **New Features**
- Added provider_options to ChatVercel; passed as
extra_body.providerOptions.
  - Supports gateway routing order (e.g., ['vertex', 'anthropic']).
  - Anthropic models now follow the optimized structured-output path.
  - Updated docs and example to show basic and provider-order usage.

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

<!-- End of auto-generated description by cubic. -->
2025-11-29 13:17:54 -08:00
mertunsall 0db058e41b Merge branch 'main' into mert/trytofixmain 2025-11-29 13:16:49 -08:00
mertunsall 3fe94db8f2 try to fix stuff 2025-11-29 13:16:14 -08:00
Mert Unsal 6bded78269 Revert "Improve demo mode" (#3687)
Reverts browser-use/browser-use#3614

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Reverts the previous demo mode overhaul and restores a single, built-in
demo panel with simpler integration. Also streams step start and
completion summaries to the panel for clearer progress.

- **Refactors**
- Embedded the panel script directly in demo_mode.py; removed
browser_use/browser/demo_panel_scripts.py.
  - Removed the demo_mode_display option; a single panel mode is used.
- Simplified session integration by removing per-target demo overlay
registration.
- Added demo-mode logs for step start and completion (agent and
notebook).
  - Raised some logs from debug to info for better visibility.
  - Cleaned up codespell ignore list in pyproject.toml.

- **Migration**
- Remove any use of profile.demo_mode_display in configs. It’s no longer
supported.

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

<!-- End of auto-generated description by cubic. -->
2025-11-29 13:14:14 -08:00
Mert Unsal a742645416 Revert "Improve demo mode" 2025-11-29 13:09:20 -08:00
AntonVishal 5c581c642e Add provider options to ChatVercel for enhanced model routing 2025-11-29 12:27:32 +05:30
Mert Unsal 77ed2b4313 Revert "allowing MUCH MORE with coordinates" (#3682)
Reverts browser-use/browser-use#3676
2025-11-28 04:00:32 -08:00
Mert Unsal 02cf38e864 Revert "allowing MUCH MORE with coordinates" 2025-11-28 04:00:22 -08:00
MagellaX d58ae80b50 Handle Mistral timeout defaults and fix pixtral mapping 2025-11-28 13:41:36 +05:30
MagellaX 71a1f12037 Format LLM exports after ruff suggestions 2025-11-28 13:32:20 +05:30