Commit Graph

8176 Commits

Author SHA1 Message Date
Mert Unsal 53af968e70 Merge branch 'main' into mert/add_ground_truth_to_judge 2025-11-12 11:36:07 -08:00
Mert Unsal a28f4268bf Delete examples/mert.py 2025-11-12 11:34:21 -08:00
Mert Unsal 461b478a49 fix: fix link in llm's readme (#3565)
fix langchain example.py link

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixed the broken LangChain example link in the LLM README by switching
to a root‑relative path (/examples/models/langchain/example.py) so it
resolves correctly.

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

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Fix broken LangChain example link in LLM README by switching to a
root-relative path.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
96266b6a26. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-11-12 11:33:18 -08:00
Mert Unsal 96266b6a26 Merge branch 'main' into fix/llm_readme 2025-11-12 11:32:53 -08:00
mertunsall 85e0bddb6a improve the example 2025-11-12 11:31:31 -08:00
mertunsall dfbba0e062 add ground truth to judge 2025-11-12 11:16:40 -08:00
reformedot cca0ad034f refactor: streamline comments and remove unused method in session.py
- Simplified comments in session.py for clarity and conciseness.
- Removed the unused `disconnect` method from the CDPSession class.
- Updated references to session management in downloads_watchdog.py for consistency.
2025-11-12 10:48:16 -08:00
reformedot 07ec978100 refactor: simplify comment in downloads_watchdog.py for clarity 2025-11-12 10:09:56 -08:00
reformedot 352c1fdfe7 fix: correct indentation in popups_watchdog.py for improved readability 2025-11-12 10:01:34 -08:00
Magnus Müller c3fe8ec759 Add polynomial to url endings (#3566)
Add 'polynomial' to the `excluded_extensions` set to prevent the agent
from automatically opening URLs containing it.

Previously, the agent would automatically navigate to URLs like
`numpy.polynomial` when encountering them in tasks, even when they
represented project paths or labels rather than web pages to be opened.
This change ensures such URLs are treated as excluded extensions,
allowing the agent to decide navigation based on context.

---
[Slack
Thread](https://browser-use.slack.com/archives/C091NM0S79T/p1762931711238959?thread_ts=1762931711.238959&cid=C091NM0S79T)

<a
href="https://cursor.com/background-agent?bcId=bc-1410a12d-a2e8-4447-8166-5e6939e45ee6"><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-1410a12d-a2e8-4447-8166-5e6939e45ee6"><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
Stops auto-navigation to URLs containing “polynomial” (e.g.,
numpy.polynomial) by adding it to excluded_extensions. This prevents
false opens of project paths/labels and lets the agent decide navigation
based on context.

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

<!-- End of auto-generated description by cubic. -->
2025-11-12 09:36:22 -08:00
Cursor Agent 8f1b73335c Add 'polynomial' to excluded file extensions
Co-authored-by: mamagnus00 <mamagnus00@gmail.com>
2025-11-12 16:57:45 +00:00
Yangong cc2e4d800c fix: fix link in llm's readme 2025-11-12 11:46:23 +00:00
Yangong 84549433c9 fix: fix link in llm's readme 2025-11-12 11:40:58 +00:00
PredictiveManish 839c1412e2 Update: ClickableElementDetector.is_interactive to ignore elements marked inert or aria-hidden 2025-11-12 17:08:52 +05:30
reformedot e9656f7e0e chore: improved timing logging 2025-11-11 20:42:32 -08:00
reformedot 6859920d68 refactor: enhance timing breakdown in DOMWatchdog and DomService for improved performance insights
- Updated DOMWatchdog to provide a detailed hierarchical breakdown of timing metrics for various operations, improving clarity in performance logging.
- Enhanced DomService to calculate and log specific timing metrics for iframe scrolling, CDP calls, and snapshot processing, contributing to more accurate performance tracking.
2025-11-11 20:38:39 -08:00
reformedot 44045765b5 refactor: improve timing metrics in DOMWatchdog and DomService for enhanced performance tracking
- Updated DOMWatchdog to exclude specific sub-timings from total tracked time to avoid double-counting.
- Enhanced DomService to calculate and log overhead timings for both get_dom_tree and get_serialized_dom_tree operations, improving accuracy in performance metrics.
2025-11-11 20:12:52 -08:00
reformedot f960519d68 Merge branch 'feat/improve-navigation' of github.com:browser-use/browser-use into feat/improve-navigation 2025-11-11 19:52:06 -08:00
reformedot e766733ef4 refactor: enhance timing metrics in DomService for improved performance tracking 2025-11-11 19:51:54 -08:00
Aitor 461d8592b1 Merge branch 'main' into feat/improve-navigation 2025-11-12 04:32:27 +01:00
reformedot b4e9ffa984 refactor: implement error handling for asyncio tasks across various components
- Introduced a utility function `create_task_with_error_handling` to manage asyncio tasks with proper exception logging and suppression options.
- Updated multiple components, including `SessionManager`, `BrowserSession`, and various watchdogs, to utilize the new error handling mechanism for background tasks.
- Enhanced overall robustness of asynchronous operations by ensuring exceptions are logged and handled appropriately, improving maintainability and debugging capabilities.
2025-11-11 17:27:54 -08:00
Mert Unsal 48c33dd6cf Adjust error reporting for partial failures (#3562)
Change agent failure logs to WARNING for partial failures and ERROR only
for complete failures to reduce log noise.

The agent now logs `WARNING` for failures 1-3 and `ERROR` only on the
4th (final) failure, which is when the agent actually stops after
hitting `max_failures`. This prevents log spam for recoverable
situations while still highlighting critical agent failures.

---
[Slack
Thread](https://browser-use.slack.com/archives/C091NM0S79T/p1762902948612619?thread_ts=1762902948.612619&cid=C091NM0S79T)

<a
href="https://cursor.com/background-agent?bcId=bc-5cd8916d-4340-4d20-978e-df0ed15329a4"><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-5cd8916d-4340-4d20-978e-df0ed15329a4"><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
Adjusted agent failure logging: WARNING for recoverable attempts, ERROR
only on the final allowed attempt. This reduces log noise while keeping
critical failures prominent.

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

<!-- End of auto-generated description by cubic. -->
2025-11-11 16:21:48 -08:00
Mert Unsal ee1b9859c4 Merge branch 'main' into cursor/adjust-error-reporting-for-partial-failures-63d8 2025-11-11 16:19:10 -08:00
mertunsall 2d5de65979 for some reason cant do self here 2025-11-11 16:18:32 -08:00
Mert Unsal 524ff133e9 change to warnings (#3563)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Downgraded CDP JavaScript click failure logs from error to warning in
DefaultActionWatchdog to reduce noisy error logs during expected
fallback behavior. Logs stay informative without masking real failures,
since exceptions are still raised where needed.

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

<!-- End of auto-generated description by cubic. -->
2025-11-11 16:15:35 -08:00
mertunsall ce9be49b32 change to self.logger 2025-11-11 16:13:33 -08:00
Mert Unsal 5b0a6bb203 Merge branch 'main' into mert/warnings 2025-11-11 16:07:02 -08:00
Cursor Agent cd4f96361a Refactor: Improve failure count message formatting
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-12 00:06:52 +00:00
mertunsall 699d14c968 change to warnings 2025-11-11 16:06:25 -08:00
Mert Unsal ed23457f78 Update browser_use/agent/service.py 2025-11-11 16:03:02 -08:00
Cursor Agent 32adb3d095 Adjust logging level for agent failures
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-12 00:01:04 +00:00
Mert Unsal b4928403d1 Optimize around Sonnet 4.5 (#3552)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add configurable screenshot resizing and coordinate-based clicking to
improve Sonnet 4.5 reliability and precise interactions. Also load an
Anthropic-specific flash system prompt to better guide Sonnet.

- **New Features**
- Add llm_screenshot_size to resize screenshots with validation;
auto-set 1400x850 for Claude Sonnet.
  - Scale LLM coordinates to the original viewport; cache viewport size.
- Support clicking by coordinates when index is unavailable, with a
non-blocking highlight.
- Expand ClickElementAction to accept index or
coordinate_x/coordinate_y.
- Use Anthropic-specific flash system prompt for Anthropic models when
flash_mode is enabled.

- **Refactors**
- Pass llm_screenshot_size through agent, message manager, and session;
resize in prompt builder.
  - Adjust screenshot tool availability to align with use_vision='auto'.
- Improve viewport logging and add highlight utility for coordinate
clicks; shorten judge failure_reason to max 5 sentences.
- Simplify extract tool inputs; pass query/extract_links/start_from_char
directly.
- Sanitize invalid UTF-8 surrogate characters in page text to prevent
encoding errors.

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

<!-- End of auto-generated description by cubic. -->
2025-11-11 15:33:15 -08:00
mertunsall a5b97a6cf4 this is not an error, just warning 2025-11-11 15:31:58 -08:00
mertunsall bc8fd10ea8 whatever 2025-11-11 15:31:58 -08:00
Mert Unsal 642ff7a362 Merge branch 'main' into mert/optimize_sonnet 2025-11-11 15:28:37 -08:00
Mert Unsal 3d661f92b4 Remove deprecated agent.context documentation (#3561)
Remove `agent.context` reference from documentation because it is
deprecated.

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

<a
href="https://cursor.com/background-agent?bcId=bc-73851c35-0197-4994-aad9-bcc2bcceb977"><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-73851c35-0197-4994-aad9-bcc2bcceb977"><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
Removed the deprecated agent.context reference from the hooks
documentation to match the current Agent API and prevent confusion. This
is a docs-only update reflecting that context is no longer supported.

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

<!-- End of auto-generated description by cubic. -->
2025-11-11 15:20:05 -08:00
Cursor Agent a92a1190c2 Remove agent.context from hooks documentation
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-11-11 23:19:24 +00:00
mertunsall 1e3a36dbce revert extract changes 2025-11-11 15:01:25 -08:00
mertunsall 3259c54ef6 Revert 2025-11-11 14:43:15 -08:00
mertunsall 6a447738da fix tests 2025-11-11 14:31:54 -08:00
reformedot 97deba7bb8 refactor: update agent focus handling and CDP session retrieval to fix tests 2025-11-11 12:57:35 -08:00
reformedot 2de09c1e53 refactor: streamline tab switching and navigation handling in BrowserSession
- Consolidated tab switching logic to improve clarity and reduce redundancy in the `on_NavigateToUrlEvent` method.
- Enhanced logging for tab switching and navigation events to provide better insights during debugging.
- Ensured proper lifecycle handling during navigation, including closing extension options pages and dispatching navigation events consistently.
2025-11-11 12:28:09 -08:00
reformedot c99e1bb41f refactor: improve type checking and linting script
- Updated `pyproject.toml` to enhance type checking configuration by refining the `exclude` list and adding an `include` section for better clarity.
- Modified `lint.sh` to run tools directly from the virtual environment, improving execution reliability and avoiding permission errors.
- Enhanced comments in `lint.sh` for better understanding of script functionality and usage.
2025-11-11 12:00:20 -08:00
Aitor 8098677a87 Merge branch 'main' into feat/improve-navigation 2025-11-11 20:41:03 +01:00
ricky-aufvaa d9ff851279 docs: add AWS Bedrock configuration to .env.example 2025-11-11 12:20:17 +05:30
mertunsall 018de804f7 fix comment 2025-11-10 21:30:39 -08:00
mertunsall 07d9e4a252 fix comment 2025-11-10 21:30:09 -08:00
reformedot 0282675ade refactor: implement lazy fetching for DOM tree construction
- Updated DOM tree retrieval methods to lazily fetch frame hierarchy only when necessary, improving performance for pages without cross-origin iframes.
- Adjusted method signatures to reflect optional frame fetching, enhancing flexibility in DOM service operations.
- Streamlined timing metrics by setting placeholders for timing logs, preparing for future performance enhancements.
2025-11-10 21:28:10 -08:00
reformedot 97420238c1 refactor: enhance DOM tree construction and timing metrics
- Updated DOM tree retrieval methods to include pre-fetched frame hierarchy, reducing redundant CDP calls and improving performance.
- Adjusted timing logs to provide detailed breakdowns of DOM tree construction, including total time and individual component timings.
- Removed commented-out code related to Python-based highlighting, streamlining the DOMWatchdog class.
- Reduced wait time in DOMWatchdog for page stability, enhancing responsiveness during DOM builds.
2025-11-10 20:53:23 -08:00
reformedot 7a31936f5d refactor: simplify session retrieval methods in SessionManager and BrowserSession
- Changed `get_session_for_target` in `SessionManager` from async to sync, improving performance by removing unnecessary locking.
- Updated all references in `BrowserSession` and related watchdogs to use the new synchronous method for session retrieval.
- Enhanced readability and consistency across session management logic, ensuring a more streamlined approach to handling sessions.
2025-11-10 19:07:01 -08:00