Commit Graph

4729 Commits

Author SHA1 Message Date
mertunsall
fd3d04537a fix 2025-07-23 19:24:20 +02:00
mertunsall
eb833d34d9 now history is cached 2025-07-23 19:08:50 +02:00
Nick Sweeting
8c0127d237 feat: add py.typed to mark the package as typed for type-checkers (#2509) 2025-07-22 11:29:58 -07:00
Vladimirs Kovalovs
858bec3b71 Merge branch 'main' into feat/add-typed-py-marker 2025-07-22 13:41:26 +02:00
Magnus Müller
9d99e64c2a fix/multi-act (#2516)
Auto-generated PR for branch: fix/multi-act
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Updated the system prompt to encourage combining related actions in one
step for better efficiency when multiple actions are allowed.

- **Prompt Improvements**
- Added clear guidelines and examples for efficient multi-action
combinations.
 - Explained when to use single actions versus grouped actions.

<!-- End of auto-generated description by cubic. -->
2025-07-22 12:21:07 +02:00
Magnus Müller
07451552b2 Fix prompts - use correct action names 2025-07-22 12:17:18 +02:00
Magnus Müller
3b93e04b4d Fix system prompt 2025-07-21 16:49:34 +02:00
Magnus Müller
e7e9c2de94 Encourage multistep 2025-07-21 16:12:35 +02:00
Vladimirs Kovalovs
21f4b317c9 typo 2025-07-21 12:59:11 +02:00
Vladimirs Kovalovs
3446447ae5 feat: add typed.py to mark the package as typed for typecheckers 2025-07-21 12:47:23 +02:00
Magnus Müller
eae2296f49 hot-fix/url-not-existing (#2505)
Auto-generated PR for branch: hot-fix/url-not-existing
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Improved logging in session.py to handle cases where the current page
URL may not exist during crashed page recovery, making debug and warning
messages clearer.

<!-- End of auto-generated description by cubic. -->
2025-07-21 00:03:56 +02:00
Magnus Müller
7af46c4093 Merge branch 'main' into hot-fix/url-not-existing 2025-07-21 00:00:09 +02:00
Magnus Müller
a63fa12f96 Enhance logging for crashed page recovery in session.py
Updated the logging messages in the require_healthy_browser function to include the current page URL during recovery attempts. This change improves the clarity of debug and warning logs by ensuring the page URL is accurately reported, even when the page is unresponsive.
2025-07-20 23:59:58 +02:00
Mert Unsal
e4651e3557 Revert "add init to make things library" (#2504)
Reverts browser-use/browser-use#2503
2025-07-20 23:58:02 +02:00
Mert Unsal
a5bc83f766 Revert "add init to make things library" 2025-07-20 23:57:53 +02:00
Mert Unsal
a224d9dfb0 add init to make things library (#2503)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added missing __init__.py files to make all subdirectories proper Python
packages and enable imports across the library.

- **Refactors**
  - Ensured each module and LLM integration is recognized as a package.
- Exposed main chat classes in each LLM integration’s __init__.py for
easier imports.

<!-- End of auto-generated description by cubic. -->
2025-07-20 23:56:43 +02:00
Mert Unsal
b0486a7e23 Merge branch 'main' into mert/fix_lazy_imports 2025-07-20 23:56:34 +02:00
mertunsall
f901a6931f add init to make things library 2025-07-20 23:55:25 +02:00
Magnus Müller
12b44eb1c2 fix temperature for reasoning models (#2502)
Auto-generated PR for: fix temperature for reasoning models
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Set temperature to 1 and frequency_penalty to 0 for reasoning models to
ensure correct parameter handling.

- **Bug Fixes**
 - Removed unsupported parameter filtering for reasoning models.
 - Updated example to use a reasoning model and show token usage.

<!-- End of auto-generated description by cubic. -->
2025-07-20 23:55:13 +02:00
Magnus Müller
330e4d9ab5 Simple example 2025-07-20 23:54:03 +02:00
Magnus Müller
d695a56923 fix temperature for reasoning models 2025-07-20 23:53:00 +02:00
Magnus Müller
d54749d8bb feat/speed-improvements-wait (#2496)
Auto-generated PR for branch: feat/speed-improvements-wait
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Improved speed and reliability by adding timeouts to LLM calls, browser
actions, and step execution, and refined the wait action to log accurate
wait times.

- **Performance and Reliability**
- Added configurable timeouts for LLM calls (default 60s) and step
execution (default 180s).
- Reduced timeouts for browser tab info and page title retrieval for
faster responses.
- Set explicit timeouts for browser actions like scroll, click, type,
and fill to prevent hangs.
- Updated the wait action to account for initial LLM wait time and
improved logging.

<!-- End of auto-generated description by cubic. -->
2025-07-20 23:30:34 +02:00
Magnus Müller
76b57a5586 Merge branch 'main' into feat/speed-improvements-wait 2025-07-20 23:23:50 +02:00
Mert Unsal
5fdd7fef29 lazy imports and bump some versions (#2501)
improve import times by setting up lazy imports
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Added lazy import logic across core modules to speed up import times and
reduce startup overhead. Updated several LLM-related dependencies to
newer versions.

- **Refactors**
- Replaced direct imports with lazy imports in main package entrypoints
and heavy modules.
- Moved some imports inside functions to avoid loading large
dependencies at startup.

- **Dependencies**
  - Bumped versions for google-genai, openai, anthropic, and groq.

<!-- End of auto-generated description by cubic. -->
2025-07-20 23:20:21 +02:00
mertunsall
5ed62da25f restored this to main 2025-07-20 23:14:07 +02:00
Magnus Müller
d9e6348a67 Include frequency_penalty 0.05 2025-07-20 23:11:23 +02:00
mertunsall
ce5bfe6195 lazy imports and bump some versions 2025-07-20 22:58:34 +02:00
Magnus Müller
7a619c3612 Refactor wait time logging in Controller to simplify message formatting 2025-07-20 16:34:27 +02:00
Magnus Müller
5b13195f56 Increase default temperature to 0.2 to avoid infinite generation 2025-07-20 16:24:41 +02:00
Magnus Müller
eafb170dec Merge branch 'main' into feat/speed-improvements-wait 2025-07-20 16:15:01 +02:00
Magnus Müller
af04b713d5 Fix lint errors 2025-07-20 16:14:42 +02:00
Mert Unsal
0b16795c1f feat: disable screenshots when vision is disabled (#2498)
Disables screenshot capture when vision is disabled to improve
performance
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Disabled screenshot capture when vision is turned off to improve
performance.

<!-- End of auto-generated description by cubic. -->
2025-07-20 16:14:16 +02:00
mertunsall
b8067da3d4 no screenshots if vision is disabled 2025-07-20 16:10:38 +02:00
Magnus Müller
c96121a98b Update wait test 2025-07-20 16:02:11 +02:00
Magnus Müller
2552825786 Update wait test 2025-07-20 15:59:20 +02:00
Magnus Müller
cbf2a783e2 Switch decorators order 2025-07-20 15:50:13 +02:00
Magnus Müller
34590509fa Change log 2025-07-20 15:45:12 +02:00
Magnus Müller
f7bd2c98e9 Run tests again 2025-07-20 15:23:14 +02:00
Magnus Müller
1531907b40 Enhance timeout handling in BrowserSession methods
- Added timeout parameters to scroll_into_view_if_needed, click, type, and fill methods to improve reliability and prevent potential hangs.
- Introduced debug observation for get_dom_element_by_index and _input_text_element_node methods to aid in tracking and debugging.
2025-07-19 20:56:30 +02:00
Magnus Müller
c7f266d52a Improved error for timeout 2025-07-19 20:55:19 +02:00
Magnus Müller
067b249da2 More tracking 2025-07-19 20:53:22 +02:00
Magnus Müller
724dc15b29 Fix timeout exception handling in Agent class
- Changed the exception type from asyncio.TimeoutError to TimeoutError for better clarity in timeout handling.
- Updated the error message to suggest generating fewer tokens in case of a timeout.
2025-07-19 20:36:56 +02:00
Magnus Müller
f436338207 Adjust timeout settings in BrowserSession for improved performance
- Reduced the retry timeout from 6 seconds to 3 seconds.
- Decreased the page title retrieval timeout from 3 seconds to 2 seconds.
- Enhanced timeout handling logic to prioritize user-defined timeouts while ensuring a minimum of 3000ms.
2025-07-19 20:32:59 +02:00
Magnus Müller
0e64c846ae Refactor wait action to adjust for initial wait time and simplify ActionResult return
- Updated the wait action to account for the initial 3 seconds already waited, ensuring accurate logging of total wait time.
- Simplified the ActionResult return by removing unnecessary parameters.
2025-07-19 19:50:13 +02:00
Magnus Müller
01f5854706 Inlcude timeout per step at 3min 2025-07-19 19:40:21 +02:00
Magnus Müller
6285bfeca0 Enable max tokens for openai and top_p 2025-07-19 19:36:49 +02:00
Magnus Müller
e43363cb0b Set maximum 1 min timeout for llm call 2025-07-19 18:56:50 +02:00
Magnus Müller
4158f20733 feature/optimize-browser-extensions (#2492)
Auto-generated PR for branch: feature/optimize-browser-extensions
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Updated the default browser extensions to use only fully automatic tools
for better single-session automation. Added Decentraleyes, ClearURLs,
and FastForward; removed extensions that require manual setup or
learning.

- **New Extensions**
 - Added Decentraleyes for CDN tracking protection.
 - Added ClearURLs to remove tracking parameters.
 - Added FastForward to bypass link shorteners.

<!-- End of auto-generated description by cubic. -->
2025-07-19 18:06:18 +02:00
Magnus Müller
bbd34cab80 Fix two extension-related bugs
1. Remove Reader View from description - extension not actually loaded
   - Updated enable_default_extensions description to only mention extensions that are actually loaded
   - Removed misleading reference to Reader View functionality

2. Resolve Chrome flag conflict for extension activity logging
   - Removed --disable-extension-activity-logging from CHROME_DEFAULT_ARGS
   - Keeps --enable-extension-activity-logging in _get_extension_args() when extensions enabled
   - Eliminates contradictory flags that caused unpredictable logging behavior
2025-07-19 16:07:52 +02:00
Magnus Müller
ec43c5c81e Fix misleading extension log message
- Track actual loaded extension names instead of hardcoding them
- Log message now accurately reflects which extensions loaded successfully
- Count and names will match even if some extensions fail to load
- Fixes bug where log mentioned 'Reader View' which was removed from extension list
2025-07-19 16:06:53 +02:00