Commit Graph

666 Commits

Author SHA1 Message Date
Aitor 802f17cf91 Merge branch 'main' into feat/add-custom-headers-support-and-example 2026-02-18 06:22:42 +01:00
reformedot de659f9768 feat: add custom headres support + add example 2026-02-17 21:15:11 -08:00
kalil0321 038ae4bc8d Merge branch 'main' into kalil0321/har_watchdog 2025-12-25 17:10:05 +01:00
SK Akram 557b0c016e fix: expose prohibited_domains in BrowserSession 2025-12-16 07:25:35 +00:00
Mert Unsal dd56615996 Merge branch 'main' into kalil0321/har_watchdog 2025-12-14 13:13:20 -08:00
Gregor Žunič b1e4d6e686 primitive skills impl (with cookies) 2025-12-08 18:07:00 -08:00
Mert Unsal a742645416 Revert "Improve demo mode" 2025-11-29 13:09:20 -08:00
kalil0321 6dbdaab6b1 Attach watchdog only when record_har_path is provided 2025-11-27 20:26:23 +01:00
kalil0321 18ac299961 Merge branch 'main' into kalil0321/har_watchdog 2025-11-27 20:21:19 +01:00
mertunsall 7e98622594 Remove wrong log{ 2025-11-26 12:40:47 -08:00
Mert Unsal cb21a1b70e Merge branch 'main' into mert/fix_screenshot_bug 2025-11-26 12:32:47 -08:00
mertunsall d7600603a2 dont change agent focus outside? 2025-11-26 12:25:40 -08:00
Mert Unsal 89990d360d Merge branch 'main' into main 2025-11-26 11:02:10 -08:00
Mert Unsal 885ec7cc6f Merge branch 'main' into mert/fix_more 2025-11-26 10:33:39 -08:00
mertunsall ad1c9b070e fix 2025-11-26 10:33:06 -08:00
Mert Unsal 8808474a39 Merge branch 'main' into kalil0321/har_watchdog 2025-11-26 10:32:40 -08:00
Mert Unsal b53a593d33 Merge branch 'main' into kalil0321/har_watchdog 2025-11-26 10:28:34 -08:00
Mert Unsal 81fe5c0573 Merge branch 'main' into kalil0321/demo-mode 2025-11-26 10:28:04 -08:00
mertunsall b2c56f63c7 better 2025-11-24 12:37:57 -08:00
Cursor Agent 36b2b93d9b Replace broken mouse click with ClickCoordinateEvent
- Add ClickCoordinateEvent to handle coordinate-based clicking via CDP
- Replace broken page.mouse.click() with CDP Input.dispatchMouseEvent
- Add safety checks for file inputs, select elements, and print dialogs
- Add get_dom_element_at_coordinates() to BrowserSession for element detection
- Add force parameter to ClickElementAction to optionally skip safety checks
- Update _click_by_coordinate to dispatch ClickCoordinateEvent instead of using mouse

This fixes coordinate clicking functionality by using CDP directly instead of
the broken Actor mouse object, matching the implementation from mert/everything_coordinates.
2025-11-24 19:55:48 +00:00
shubham-021 b03d450c70 fix/linting_issue 2025-11-22 19:19:37 +05:30
shubham-021 73c294f7a3 fix/cdp_url_parsing 2025-11-22 18:47:36 +05:30
kalil0321 50bafbd9aa Change log level from info to debug for session data clearing and browser session reset messages 2025-11-18 18:52:43 +01:00
kalil0321 574b9e3472 Address cubic issue 2025-11-18 18:49:04 +01:00
kalil0321 1de03304e1 Address cubic 2025-11-18 18:25:38 +01:00
kalil0321 5c41ea9112 implementlogs persistence 2025-11-18 17:30:07 +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
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
kalil0321 0988199776 Merge branch 'main' into kalil0321/demo-mode 2025-11-13 15:34:49 +01:00
Aitor c662b29b31 Merge branch 'main' into feat/improve-navigation 2025-11-13 05:37:09 +01:00
mertunsall a2e81f17d7 more logging 2025-11-12 20:28:23 -08:00
reformedot b741c429d7 refactor: streamline event handling in BrowserSession
- Adjusted the structure of event handling for 'networkIdle' and 'load' events to improve readability and maintainability.
- Ensured that logging for page readiness is consistently executed within the event handling logic.
2025-11-12 20:02:38 -08:00
reformedot 77d7f161fb refactor: enhance session management and error handling in BrowserSession
- Improved the `create_task_with_error_handling` function to allow for better exception logging and retrieval based on the `suppress_exceptions` parameter.
- Updated `SessionManager` to implement event-driven recovery for stale agent focus, replacing polling with efficient event handling.
- Refactored session retrieval methods to ensure focus validation and recovery are handled automatically.
- Enhanced logging for recovery processes and session management to provide clearer insights into state changes and errors.
- Adjusted various watchdogs to utilize the new session management methods, ensuring they correctly handle focus validation and session retrieval.
2025-11-12 19:42:24 -08:00
reformedot 91e82ae85e chore: update cdp-use dependency version and increase max WebSocket frame size in BrowserSession
- Updated cdp-use dependency to version 1.4.4 for improved functionality.
- Increased max WebSocket frame size to 200MB in BrowserSession to accommodate large DOMs.
2025-11-12 18:00:14 -08:00
reformedot 060ab445a9 refactor: streamline target validation in BrowserSession 2025-11-12 16:44:07 -08:00
reformedot bff596f2e7 refactor: remove target type caching and streamline target retrieval in session management
- Eliminated the caching of target types in SessionManager, simplifying the management of target information.
- Updated various components to directly access target types from the Target objects, enhancing clarity and reducing redundancy.
- Adjusted related methods in BrowserSession, CrashWatchdog, and DomService to reflect the changes in target type retrieval.
2025-11-12 15:19:34 -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
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
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 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
kalil0321 3f64178894 Implement demo mode for in-browser logging 2025-11-08 21:39:57 +01:00
mertunsall d06d8fa8a2 image resizing the make sonnet 4.5 work 2025-11-07 22:20:14 -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