Commit Graph

4189 Commits

Author SHA1 Message Date
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 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
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
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
mertunsall 1e3a36dbce revert extract changes 2025-11-11 15:01:25 -08:00
mertunsall 3259c54ef6 Revert 2025-11-11 14:43:15 -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
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
reformedot bf350bc4b0 refactor: update agent focus handling to use target ID consistently
- Replaced instances of `agent_focus` with `agent_focus_target_id` across various components to ensure consistent target management.
- Enhanced error handling and logging in `Watchdog` classes to reflect the new target ID approach.
- Improved session retrieval methods to streamline interactions with the `SessionManager`, ensuring better performance and reliability.
2025-11-10 14:29:50 -08:00
reformedot d39ed5869c fix: ensure target URL is correctly handled in focus change events
- Updated focus change event dispatch in `SessionManager` to use a fallback URL ('about:blank') when the target is not found, preventing potential errors.
- Modified `BrowserSession` to exclude the `session_manager` from serialization, ensuring cleaner data handling.
2025-11-10 14:09:23 -08:00
reformedot 043897c665 refactor: enhance session and target management in SessionManager
- Introduced a new `Target` class to represent browser targets, separating target properties from session management.
- Updated `SessionManager` to maintain a single source of truth for all targets and sessions, improving data integrity.
- Refactored session retrieval methods to ensure consistent access to sessions and targets, enhancing performance and readability.
- Improved logging for session and target operations, providing clearer insights into state changes and actions.
2025-11-10 13:59:43 -08:00
reformedot eb63257eee refactor: streamline logging and remove redundant timing checks 2025-11-10 11:57:27 -08:00
mertunsall ddc74d217f remove useless logging 2025-11-08 23:01:41 -08:00
mertunsall 0f5237a6e6 fix problems with utf-8 decoding 2025-11-08 19:00:40 -08:00
YangQuan 1405ab1978 Merge branch 'main' into main 2025-11-09 09:38:03 +08:00
kalil0321 55493cbdda Add demo mode logging for LLM calls and output previews 2025-11-08 22:43:46 +01:00
kalil0321 6a828ed98f Update demo mode to use textContent for message rendering, enhancing security by preventing HTML injection. 2025-11-08 21:52:06 +01:00
kalil0321 3f64178894 Implement demo mode for in-browser logging 2025-11-08 21:39:57 +01:00
mertunsall ed5128c302 sonnet has 1400x850 default screenshot size 2025-11-08 10:45:59 -08:00
mertunsall e5df80a0d6 flatten the extract action and some small things 2025-11-08 10:02:15 -08:00
mertunsall 94aeb5d385 add system prompt special to anthropic 2025-11-08 09:56:15 -08:00
mertunsall f3961e0b39 ask for shorter judge output 2025-11-08 09:55:02 -08:00
mertunsall d06d8fa8a2 image resizing the make sonnet 4.5 work 2025-11-07 22:20:14 -08:00
mertunsall 8dc9a883d2 no need for screenshot tool when use_vision is True 2025-11-07 20:05:02 -08:00
reformedot bcd88c21c2 refactor: optimize session handling and logging
- Removed redundant responsiveness checks and improved timing logs in `BrowserSession`.
- Updated focus change logic to retrieve target type from `SessionManager`, reducing CDP calls.
- Enhanced `DownloadsWatchdog` to obtain target URL directly from session data, improving efficiency.
2025-11-07 16:57:28 -08:00
reformedot e64edf82d6 chore: added timing logs 2025-11-07 16:13:58 -08:00
reformedot 0b89bfd7ba feat: add method to retrieve all page sessions and refactor navigation logic
- Introduced `get_all_page_sessions` method in `SessionManager` to fetch all active page/tab sessions.
- Updated `BrowserSession` to utilize the new method for improved navigation and tab management, enhancing performance and readability.
- Refactored related navigation event handling to leverage cached session data instead of direct CDP calls.
2025-11-07 13:09:34 -08:00
reformedot af9123edd4 fix: fixed lifecycle event monitoring 2025-11-07 11:10:23 -08:00
Aitor e0e6491c5d Merge branch 'main' into feat/improve-navigation 2025-11-07 19:33:03 +01:00
reformedot 813e5e3589 fix: fixed navigation events check 2025-11-07 10:29:54 -08:00
reformedot 984a8c678b feat: enhance session management with target discovery and event handling
- Enabled target discovery to automatically receive targetInfoChanged events, reducing the need for polling.
- Added event handler for targetInfoChanged to update session title and URL dynamically.
- Improved initialization of existing targets to ensure monitoring readiness without race conditions.
- Updated navigation logic to utilize cached session data for faster access to target information.
2025-11-07 10:20:11 -08:00
reformedot 027fae6c23 fix: improved session manager 2025-11-06 21:10:26 -08:00
reformedot 62c0495ef0 fix: enable page monitoring on already existing targets 2025-11-06 17:53:56 -08:00
kalil0321 24508d69f5 Merge branch 'main' into kalil0321/codeagent-api-improv 2025-11-07 02:12:48 +01:00
Mert Unsal 38fb9faaa4 Merge branch 'main' into mert/click_by_coordinate 2025-11-06 16:54:11 -08:00
kalil0321 ff1db95889 Merge branch 'main' into add-vercel-ai-gateway 2025-11-07 01:33:46 +01:00