Commit Graph

7768 Commits

Author SHA1 Message Date
Reagan Hsu 27b797eaf9 new brev setup 2025-11-18 16:01:34 -08:00
Reagan Hsu f7c171de9e new brev setup 2025-11-18 15:54:44 -08:00
Reagan Hsu ac066f21f8 this isn't working yet but we will see 2025-11-18 15:45:54 -08:00
Mert Unsal 8a8ef967b2 more timeout for gemini 3 pro (#3618) 2025-11-18 11:54:57 -08:00
mertunsall 67e2d779d8 more timeout for gemini 3 pro 2025-11-18 11:54:23 -08:00
Magnus Müller 8a6e0ea74b bump 0.9.7 (#3617)
Auto-generated PR for: bump 0.9.7

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
b16adeb1f5. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Updated package version from 0.9.6 to 0.9.7 in pyproject.toml to prepare
the next release.

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

<!-- End of auto-generated description by cubic. -->
0.9.7
2025-11-18 08:34:26 -08:00
Magnus Müller b16adeb1f5 bump 0.9.7 2025-11-18 08:33:56 -08:00
Magnus Müller 3d1afb3a05 gemini 3 (#3616)
Auto-generated PR for: gemini 3

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
45532c454e. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-18 08:31:28 -08:00
Magnus Müller 45532c454e gemini 3 2025-11-18 08:31:10 -08:00
Gregor Žunič 30a3c187f0 Updated Laminar docs (#3600)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Update observability docs to reflect the latest Laminar integration:
auto-capture of agent steps, costs, and browser session recordings, with
clearer setup and usage. Also refreshes links and the screenshot.

- **Documentation**
  - Updated links to laminar.sh and added self-host option.
- Simplified install: pip install lmnr; use LMNR_PROJECT_API_KEY env
var.
- Revised usage example: initialize Laminar via env, auto-instrument
Browser Use; switched to ChatGoogle.
- Clarified trace UI and timeline sync; mention session recording
playback.
  - Updated laminar.png image.

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

<!-- End of auto-generated description by cubic. -->
2025-11-17 17:23:38 -08:00
Gregor Žunič 533d40c6e9 Merge branch 'main' into laminar-docs 2025-11-17 17:22:25 -08:00
Mert Unsal 923a0141a1 fix max steps bug (#3607)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes incorrect step counting in the agent’s main loop so it stops
exactly at max_steps and shows accurate step numbers during
pause/resume.

- **Bug Fixes**
- Switch from for-range to a while loop driven by self.state.n_steps to
respect max_steps reliably.
- Pass a 0-indexed current_step to AgentStepInfo and _execute_step for
correct indexing and logs.

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

<!-- End of auto-generated description by cubic. -->
2025-11-17 14:55:06 -08:00
mertunsall 54bf853e8b fix max steps bug 2025-11-17 14:51:30 -08:00
Mert Unsal de0654463a Configure screenshot size for browser-use models (#3603)
Auto-configure `llm_screenshot_size` for models containing 'browser-use'
in their name to match Claude Sonnet models.

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

<a
href="https://cursor.com/background-agent?bcId=bc-f89be972-8372-40ba-a6e2-40167ffaa94c"><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-f89be972-8372-40ba-a6e2-40167ffaa94c"><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
Auto-configure the LLM screenshot size to 1400x850 for models whose name
includes “browser-use,” matching the Claude Sonnet default when
llm_screenshot_size is not provided. This ensures consistent screenshot
dimensions across browser-use and Claude Sonnet models.

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

<!-- End of auto-generated description by cubic. -->
2025-11-16 17:34:48 -08:00
Cursor Agent efc0f83063 Fix: Auto-configure screenshot size for browser-use models
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-17 01:32:56 +00:00
Robert Kim 5f4ee0c4a3 Updated Laminar docs 2025-11-16 14:55:03 +00:00
Mert Unsal c08b204a1e Revert "Fix: Ignore Inert Carousel Elements" (#3598)
Reverts browser-use/browser-use#3564
2025-11-15 23:05:35 -08:00
Mert Unsal fb8994de13 Revert "Fix: Ignore Inert Carousel Elements" 2025-11-15 23:05:21 -08:00
Mert Unsal ecf1c21c62 Fix: Ignore Inert Carousel Elements (#3564)
Fix for the issue: #3386 
---------------------------------------
Description: 
- Prevents `ClickableElementDetector` from returning elements flagged
inert or aria-hidden, so wrap-around carousel clones don’t show up as
interactable targets.
- Ensures the agent only clicks the visible, active product in
`nuka-carousel` lists.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Ignore elements marked inert or aria-hidden in ClickableElementDetector
so invisible carousel clones (e.g., nuka-carousel) aren’t treated as
clickable. This prevents clicks on hidden items and ensures the agent
targets only the visible, active product.

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

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Exclude elements with `inert` or `aria-hidden` from interactive
detection to avoid hidden clones being treated as clickable.
> 
> - **DOM/Interaction Detection**:
> - `browser_use/dom/serializer/clickable_elements.py`:
`ClickableElementDetector.is_interactive` now skips nodes with `inert`
or `aria-hidden` (true/1) attributes to prevent hidden elements from
being considered clickable.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b11682bfb5. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-15 19:01:12 -08:00
Mert Unsal b11682bfb5 Merge branch 'main' into Invisible-links 2025-11-15 18:59:55 -08:00
Magnus Müller 00e65b45b9 bump version 0.9.6 (#3597)
Auto-generated PR for: bump version 0.9.6

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
49189cb005. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0.9.6
2025-11-15 11:50:48 -08:00
Magnus Müller 49189cb005 bump version 0.9.6 2025-11-15 11:50:36 -08:00
Magnus Müller 06cf7feac5 disable telemetry logs for chatbrowseruse (#3596)
Auto-generated PR for: disable telemetry logs for chatbrowseruse

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Passes `anonymized_telemetry` from `CONFIG.ANONYMIZED_TELEMETRY` in
`ChatBrowserUse.ainvoke` request payload to control telemetry behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1f6d606fac. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->



<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Disables telemetry logging for ChatBrowserUse by sending the
anonymized_telemetry flag from CONFIG in the ainvoke request payload.
Telemetry now respects the global ANONYMIZED_TELEMETRY setting, allowing
logs to be suppressed when disabled.

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

<!-- End of auto-generated description by cubic. -->
2025-11-15 10:55:49 -08:00
Magnus Müller 1f6d606fac Linter 2025-11-15 10:11:55 -08:00
Magnus Müller 51ba3422c3 disable telemetry logs for chatbrowseruse 2025-11-15 10:11:08 -08:00
Mert Unsal fc0d4b64ec Set default max actions per step (#3594)
Update `max_actions_per_step` default from 10 to 4 across the codebase
and documentation.

This change aligns with the cloud service behavior and improves
form-filling efficiency while reducing instability from multiple
simultaneous browser actions.

---
[Slack
Thread](https://browser-use.slack.com/archives/C09SGG1L8RK/p1763187387977299?thread_ts=1763187387.977299&cid=C09SGG1L8RK)

<a
href="https://cursor.com/background-agent?bcId=bc-c9bff35a-7764-4427-a45e-3c7df9c0d868"><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-c9bff35a-7764-4427-a45e-3c7df9c0d868"><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
Set the default max_actions_per_step to 4 (was 10) to match the cloud
service. This makes form filling more stable and avoids issues when too
many actions run at once.

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

<!-- End of auto-generated description by cubic. -->
2025-11-14 22:33:46 -08:00
Cursor Agent 487bd19e80 Refactor: Lower default max_actions_per_step to 4
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-15 06:31:10 +00:00
Magnus Müller 4906c61ca5 update readme2 (#3593)
Auto-generated PR for: update readme2

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
2bed21c45f. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-14 21:52:01 -08:00
Magnus Müller 2bed21c45f update readme2 2025-11-14 21:51:39 -08:00
Mert Unsal e90bca507e we call the judge before done callback to enable in the cloud (#3592) 2025-11-14 17:27:22 -08:00
mertunsall 7dc5f5bf24 we call the judge before done callback to enable in the cloud 2025-11-14 17:25:53 -08:00
Aitor 4a6d5ec29b refactor: change stop/reset logs from info to debug (#3591)
change logging level from info to debug in BrowserSession methods

Updated the logging level for session management methods in
BrowserSession to debug for more granular logging. This change applies
to the reset, kill, and stop methods, enhancing the clarity of log
outputs during browser session operations without cluttering the info
logs.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Lowered the log level for BrowserSession reset(), kill(), and stop()
messages from info to debug. This reduces noise in info logs while
keeping detailed session lifecycle events available for troubleshooting.

- **Refactors**
- Replaced logger.info with logger.debug in reset(), kill(), and stop().
  - No runtime behavior changes; logging only.

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

<!-- End of auto-generated description by cubic. -->
2025-11-14 22:59:33 +01:00
reformedot 2d433dca4b refactor: change logging level from info to debug in BrowserSession methods
Updated the logging level for session management methods in BrowserSession to debug for more granular logging. This change applies to the reset, kill, and stop methods, enhancing the clarity of log outputs during browser session operations without cluttering the info logs.
2025-11-14 13:49:20 -08:00
Aitor ddbfb42554 fix: improve CDPClient cleanup (#3590)
Enhance SessionManager and BrowserSession with defensive checks and
connection management

- Added defensive checks in SessionManager to skip target attachment and
focus recovery if the browser is shutting down (i.e., _cdp_client_root
is None).
- Introduced a connection lock in BrowserSession to prevent concurrent
connection attempts, ensuring safe CDP client management.
- Improved logging for session reset and connection handling, providing
clearer insights into the browser session state during operations.
- Enhanced error handling when stopping the CDP client and clearing
session manager state on initialization failures.

These changes improve the robustness and reliability of session
management in the browser environment.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Improved CDP client cleanup and connection handling to prevent race
conditions and stale sessions, making browser start/stop more reliable.

- **Bug Fixes**
  - Added a connection lock to block concurrent connect attempts.
- Closed CDP WebSocket during reset/stop/kill before clearing state,
with clearer logs.
- Skipped target attach and focus recovery when the CDP client is absent
(browser shutting down).
- On connect failure or duplicate connect, stopped the existing client,
cleared SessionManager, and reset state.

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

<!-- End of auto-generated description by cubic. -->
2025-11-14 22:23:25 +01:00
reformedot 6c1f772a2d Enhance SessionManager and BrowserSession with defensive checks and connection management
- Added defensive checks in SessionManager to skip target attachment and focus recovery if the browser is shutting down (i.e., _cdp_client_root is None).
- Introduced a connection lock in BrowserSession to prevent concurrent connection attempts, ensuring safe CDP client management.
- Improved logging for session reset and connection handling, providing clearer insights into the browser session state during operations.
- Enhanced error handling when stopping the CDP client and clearing session manager state on initialization failures.

These changes improve the robustness and reliability of session management in the browser environment.
2025-11-14 13:05:18 -08:00
Mert Unsal 94a98e56e9 sanitize everything now (#3588)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Prevent UTF-8 encoding errors by sanitizing surrogate characters across
the agent and tools. Centralizes sanitization and applies it to
DOM-derived text and extraction inputs.

- **Bug Fixes**
- Sanitize state_description in get_user_message to avoid encoding
crashes.
  - Sanitize content and query in extract() to prevent UTF-8 errors.

- **Refactors**
  - Moved sanitize_surrogates to utils and reused it across modules.
  - Removed the local _sanitize_surrogates method from prompts.py.

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

<!-- End of auto-generated description by cubic. -->
2025-11-14 11:17:05 -08:00
mertunsall a64c82ef2c sanitize everything now 2025-11-14 11:13:57 -08:00
Magnus Müller 5bc077c274 Implement demo mode for in-browser logging (#3554)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a demo mode that injects a side panel into the browser to stream
live agent logs and state. This lets you follow actions, thoughts,
errors, and results without checking the console.

- **New Features**
- New demo_mode flag in Agent, CodeAgent, and BrowserProfile (default
off).
- In-browser panel injected via CDP with a DemoMode helper;
BrowserSession exposes send_demo_mode_log(); panel renders text safely
(no HTML).
- Agent/CodeAgent now log step start/completion, actions (with params),
LLM responses/thinking, evaluations, memory, partial results, errors,
and final result to the panel; CodeAgent adds a sample output preview
cell.
  - Short delay before auto-close to allow reading final messages.
- DOM serializer passes session_id and filters out overlay elements
using a session-specific data-browser-use-exclude-<session_id>
attribute.
  - Example added: examples/demo_mode_example.py.

- **Migration**
  - Enable with demo_mode=True on Agent/CodeAgent or in BrowserProfile.
- Run with headless=False to see the panel (warning logged if
headless=True).
  - No changes needed if you don’t use demo mode.

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

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

















<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds an optional demo mode that injects a browser side panel to stream
live agent/code-agent logs, with session-scoped DOM exclusion and
logging hooks across the stack.
> 
> - **Demo Mode (browser UI)**:
> - New `DemoMode` helper and injected JS panel streaming logs via
`window` events; persisted per-page, toggleable floating button.
> - `BrowserProfile.demo_mode` flag (default false);
`BrowserSession.demo_mode` lazy helper; `send_demo_mode_log()` API;
auto-injected on start; warns if headless.
> - **Agents Integration**:
> - `Agent` and `CodeAgent` accept `demo_mode`; broadcast step
start/completion, actions (and params), LLM
responses/thinking/evaluations, memory/next goal, errors, and
final/partial results to the panel.
> - Small UX: short delay before auto-close to read final messages;
CodeAgent adds a sample output preview cell.
> - **DOM/Serialization**:
> - Pass `session_id` to `DOMTreeSerializer`; filter elements marked
with session-specific `data-browser-use-exclude-<session_id>` (fallback
to legacy attr); propagation through `DomService`,
`Page.get_element_by_prompt`.
> - **Session/Startup**:
> - Inject demo overlay on connect/start (local or cloud); reset on
session reset.
> - **Example**:
> - `examples/demo_mode_example.py` showcasing `Agent(...,
demo_mode=True)`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c29e358b9c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-13 22:55:24 -08:00
Magnus Müller c29e358b9c Merge branch 'main' into kalil0321/demo-mode 2025-11-13 22:37:38 -08:00
Magnus Müller 37395635dd Fix upgrade command to use == instead of @ for uv compatibility (#3573) (#3583)
Resolves #3573 

Changed upgrade message from `uv add browser-use@X.X.X` to `uv add
browser-use==X.X.X`

The @ syntax fails with "Expected path to end in a supported file
extension" error.
uv requires PEP 508 format (==) not npm-style (@).


**Example for bug:**

(base) thomaybalazs@Mac browser-use % uv add --dev browser-use@0.9.5
error: Failed to parse: `browser-use@0.9.5`
Caused by: Expected path
(`/Users/thomaybalazs/Projects/browser-use/0.9.5`) to end in a supported
file extension: `.whl`, `.tar.gz`, `.zip`, `.tar.bz2`, `.tar.lz`,
`.tar.lzma`, `.tar.xz`, `.tar.zst`, `.tar`, `.tbz`, `.tgz`, `.tlz`, or
`.txz`
browser-use@0.9.5
            ^^^^^

(base) thomaybalazs@Mac browser-use % uv add --dev browser-use==0.9.5
Resolved 403 packages in 548ms
Built browser-use @ file:///Users/thomaybalazs/Projects/browser-use
Prepared 1 package in 268ms
Uninstalled 1 package in 1ms
Installed 1 package in 1ms
~ browser-use==0.9.5 (from
file:///Users/thomaybalazs/Projects/browser-use)


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes the upgrade command shown in agent logs to use uv’s PEP 508 syntax
with == instead of @, so copy-pasting the suggestion works without parse
errors.

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

<!-- End of auto-generated description by cubic. -->
2025-11-13 22:14:46 -08:00
Magnus Müller d454a67091 Merge branch 'main' into fix-upgrade-command-syntax 2025-11-13 22:14:39 -08:00
Larsen Cundrič 174747009e InterruptedError is due to user interrupting, so should be warning (#3585) 2025-11-13 21:48:35 -08:00
LarsenCundric deea28b4bb InterruptedError is due to user interrupting, so should be warning 2025-11-13 21:46:52 -08:00
kalil0321 1c85a8a688 Fix lint 2025-11-13 15:49:43 +01:00
kalil0321 0988199776 Merge branch 'main' into kalil0321/demo-mode 2025-11-13 15:34:49 +01:00
Balázs Thomay dc9dbbeddd Fix upgrade command to use == instead of @ for uv compatibility 2025-11-13 12:17:56 +01:00
Larsen Cundrič 1339007f9f Handle None session_manager in DownloadsWatchdog network handler (#3582)
### Problem:
AttributeError: 'NoneType' object has no attribute
'get_target_id_from_session_id' occurred when the network response
handler ran after browser shutdown or before connection, when
session_manager was None.

### Root Cause:
The global Network.responseReceived callback can fire after
session_manager is cleared during _disconnect_from_browser(), causing a
race condition.

### Solution:
Added a None check before accessing
session_manager.get_target_id_from_session_id() in on_response_received,
returning early if session_manager is None. Added a warning log for
visibility.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Handled None session_manager in DownloadsWatchdog to avoid crashes when
Network.responseReceived fires during browser shutdown or before
connection. We now skip network monitoring and log a warning if
session_manager is missing.

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

<!-- End of auto-generated description by cubic. -->
2025-11-12 22:29:05 -08:00
LarsenCundric a3e1ed7274 Skip if none 2025-11-12 22:24:56 -08:00
Mert Unsal dc9e0a17fb add the system prompt (#3580) 2025-11-12 21:46:59 -08:00
mertunsall 3ec547135b add the system prompt 2025-11-12 21:46:25 -08:00