Commit Graph

1448 Commits

Author SHA1 Message Date
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 01f5854706 Inlcude timeout per step at 3min 2025-07-19 19:40:21 +02:00
Magnus Müller e43363cb0b Set maximum 1 min timeout for llm call 2025-07-19 18:56:50 +02:00
மனோஜ்குமார் பழனிச்சாமி 95009f7d95 Add runtime type check for llm in Agent init
Added a type check to ensure the llm argument is an instance of BaseChatModel in Agent's constructor, raising a ValueError otherwise. Also marked BaseChatModel as @runtime_checkable to support isinstance checks.
2025-07-19 13:54:12 +05:30
Magnus Müller b7d29f54e8 Wait inside multiact 2025-07-19 01:40:41 +02:00
Enzo Biondo 52e287aa93 Merge branch 'main' into feat/custom-screenshot-quality 2025-07-18 19:50:25 -03:00
Magnus Müller 04e780124c Merge remote-tracking branch 'origin/HEAD' into speed-improvements 2025-07-19 00:10:24 +02:00
Nick Sweeting d2dbe538c9 disable bubus WAL for now 2025-07-18 12:49:39 -07:00
Magnus Müller 15dd27f2b5 Dont take screenshots in multact and move get_browser_state_with_recovery to the browser session 2025-07-18 18:11:45 +02:00
Magnus Müller 3ae32e5092 Remove Remove_highlights only use it before we screenshot 2025-07-18 17:40:56 +02:00
Enzo Biondo 4133b17ad8 Merge branch 'main' into feat/custom-screenshot-quality 2025-07-18 11:52:41 -03:00
EnzoFanAccount ec9223b3e4 add vision_detail_level param 2025-07-18 11:40:52 -03:00
Magnus Müller c42aae3eaf Fix line formatting in agent service for cdp_url assignment 2025-07-18 16:37:24 +02:00
Magnus Müller 3179fb7686 Merge branch 'main' into feat/cdp-url-agent-event 2025-07-18 16:32:07 +02:00
Magnus Müller 061e24b976 Merge remote-tracking branch 'origin/main' into extraction-magnus-revert-with-main 2025-07-14 18:35:21 +02:00
Magnus Müller 48c9035566 Merge remote-tracking branch 'origin/main' into laminar-ignore-input-output 2025-07-14 13:23:45 +02:00
mertunsall c91b20367c test laminar from branch and small fix 2025-07-13 17:01:19 +02:00
Magnus Müller a72e0ac062 Dont remove highlights in multiact 2025-07-12 23:33:43 +02:00
mertunsall 5757ef344f default it to False for now 2025-07-12 23:24:18 +02:00
mertunsall 5ccf02b794 fixes 2025-07-12 22:04:18 +02:00
mertunsall 0b03b24bab temporarily set flash mode True for evals 2025-07-12 21:48:30 +02:00
mertunsall d490087a28 FLASH MODE 2025-07-12 21:46:48 +02:00
Aitor d3ad893ea2 Merge branch 'main' into feat/cdp-url-agent-event 2025-07-12 00:48:22 +02:00
mertunsall 92da75520b fixes based on evals 2025-07-11 18:36:58 +02:00
mertunsall 7b8e82563d hotfix 2025-07-11 18:11:12 +02:00
Mert Unsal 57f25218a5 Apply suggestions from code review
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-11 18:10:27 +02:00
mertunsall d1f532b45d - remove append_file and instead merge it into write_file
- new replace_file_str
- add trailing new lines and leading_newline parameters to writing into file for robustness
- adapt system prompts accordingly
2025-07-11 17:58:01 +02:00
Gregor Žunič 7bf17064f6 started migration to pure cdp 2025-07-11 14:19:22 +02:00
Gregor Žunič 779196d74c nicer types 2025-07-10 22:28:53 +02:00
Magnus Müller 6407c10918 laminar-ignore input output 2025-07-09 22:27:22 +02:00
mertunsall c00f66d338 1. fix the bug that auto downloads were not available immediately to the agent
2. make available_file_paths a state of the agent instead of setting and update it regularly.
2025-07-09 15:27:08 +02:00
Gregor Žunič 8a2eda1828 wip, started migrating to pure cdp 2025-07-09 12:22:21 +02:00
Magnus Müller 1eb6ea28c0 Update observability decorators in service classes
- Added `ignore_output=True` to the `@observe_debug` decorator in the Agent and BrowserSession classes to suppress output for specific methods.
- Updated the `@observe_debug` decorator in the MessageManager class to include `ignore_input=True` for better control over debug logging.
2025-07-09 10:04:05 +02:00
Magnus Müller e9b20b67a8 Refactor error handling in Agent class
- Moved the handling of InterruptedError to a separate conditional block for improved clarity.
- Updated logging to use error level for InterruptedError, enhancing visibility of interruptions.
- Simplified the last result state update by removing unnecessary parameters.
2025-07-09 02:04:35 +02:00
Magnus Müller 15ec11e768 Enhance error handling in Agent class step execution
- Updated error logging to use the instance logger for better context.
- Incremented consecutive failures count and updated last result state upon timeout errors for improved state management.
2025-07-09 01:52:23 +02:00
Magnus Müller 2d31052e3d Update step handling in Agent class
- Adjusted the initialization of the step counter to start from 1 in AgentState.
- Updated logging messages throughout the Agent class to reflect the correct step number after the refactor.
- Removed the previous increment of n_steps from the middle of the step method, ensuring it is now incremented only at the start of the method for better clarity and tracking.
2025-07-09 01:45:28 +02:00
Magnus Müller 9a83fedd53 Refactor Agent step handling and logging
- Moved step timing initialization and step counter increment to the start of the step method for better tracking.
- Updated logging messages to reflect the correct step number after the refactor.
- Increased timeout for step execution to 5 minutes and added graceful handling for timeout errors.
- Adjusted initial value of n_steps in AgentState to start from 0 instead of 1.
- Added observability decorators to resource monitoring functions for improved debugging.
2025-07-09 01:07:32 +02:00
Magnus Müller 90d4898322 Clean up 2025-07-09 00:49:19 +02:00
Magnus Müller 542bcdacfd Merge remote-tracking branch 'origin/main' into refactor-agent-stable 2025-07-09 00:01:52 +02:00
Magnus Müller 0682e32f1b Fix deprecated asyncio.TimeoutError usage 2025-07-08 23:30:39 +02:00
Magnus Müller 6f221ec504 Refactor message management to categorize messages by type. Updated methods to handle system, state, and consistent messages separately, improving message retrieval and organization. 2025-07-08 23:09:38 +02:00
Magnus Müller 6cbace0321 Remove remove message 2025-07-08 22:47:11 +02:00
Magnus Müller 6f446b8a03 Increase timeouts 2025-07-08 22:24:17 +02:00
Magnus Müller fd40f86677 Refactor agent step execution and error handling
- Updated the step method to consolidate LLM interaction and action execution into a single try block for improved performance.
- Introduced a fallback mechanism for state summary retrieval, logging errors more effectively.
- Enhanced error handling to manage InterruptedError and other exceptions uniformly.
- Refactored context preparation and action execution methods for clarity and consistency.
- Implemented a new method for creating history items to streamline history management.
2025-07-08 15:47:57 +02:00
Magnus Müller fbc056660c Merge remote-tracking branch 'origin/main' into refactor-agent-stable 2025-07-08 14:06:22 +02:00
mertunsall 1bb9b05016 fix 2025-07-08 13:04:12 +02:00
Mert Unsal c939d63794 Merge branch 'main' into mert/autodownloadpdf 2025-07-08 12:54:17 +02:00
mertunsall 8f7f3d184d Sync system prompts 2025-07-08 12:50:45 +02:00
Nick Sweeting af0697f12b fix tests and other improvements 2025-07-08 02:41:48 -07:00
Nick Sweeting 9e9cce40f6 simplify error logging and fix timeouts 2025-07-07 21:29:03 -07:00