Commit Graph

103 Commits

Author SHA1 Message Date
Magnus Müller
e1e8003c24 Fix: Ensure direct action calls go through act() for consistent error handling
The action_wrapper now delegates to act() instead of calling registry.execute_action() directly.
This ensures:
- Consistent error handling (returns ActionResult with error, not raw exceptions)
- Consistent result normalization (always returns ActionResult)
- Full observability (Laminar spans, logging)
- Proper handling of BrowserError and TimeoutError

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 19:34:18 -07:00
Magnus Müller
56a301ed7d Linter 2025-10-24 19:26:14 -07:00
Magnus Müller
c9137fe029 Add direct action call API to Tools via __getattr__
Enable simpler, more ergonomic action calls in tests and direct usage:
- Old API: tools.act(NavigateActionModel(navigate=GoToUrlAction(...)), browser_session)
- New API: tools.navigate(url=..., browser_session=browser_session)

Implementation:
- Added __getattr__ method to Tools class that dynamically creates action wrappers
- Delegates to existing registry.execute_action() to avoid code duplication
- Works with all Tools subclasses (Tools, CodeAgentTools, custom subclasses)
- Works with custom registered actions
- Maintains full backward compatibility with existing act() API

Benefits:
- Significantly reduces boilerplate in tests
- More intuitive and Pythonic API
- All existing code continues to work unchanged
- No code duplication (delegates to registry)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 19:25:00 -07:00
Magnus Müller
1f58f60c2e Fix evaluate 2025-10-21 21:50:41 -07:00
Magnus Müller
4d5261418e 2 upload function 2025-10-21 21:44:27 -07:00
Magnus Müller
9caa248316 Merge code7 branch changes 2025-10-21 18:55:54 -07:00
Magnus Müller
c13c44be5f Fix js include matches 2025-10-14 16:40:43 -07:00
Magnus Müller
8736825e39 No comments 2025-10-14 16:05:56 -07:00
Magnus Müller
4440c187af evaluate js 2025-10-14 16:03:13 -07:00
Magnus Müller
b5afe2fece Linter 2025-10-14 15:41:13 -07:00
Magnus Müller
c9b99797fb Better parsing 2025-10-14 15:35:41 -07:00
Magnus Müller
2f43b5cfbe Parse js 2025-10-14 15:25:48 -07:00
Magnus Müller
20f8ef81e1 Unify extract in actor and tools 2025-10-13 21:11:26 -07:00
Magnus Müller
84395f1641 Filter out json and metadata from markdown 2025-10-13 20:31:21 -07:00
Magnus Müller
cf09b81af3 Update to markdownify 2025-10-13 20:07:38 -07:00
Magnus Müller
6316ae693b First version 2025-10-13 18:58:21 -07:00
Magnus Müller
74f0c25b8e Fix memory 2025-10-12 16:20:10 -07:00
Magnus Müller
4078b6e265 Remove while_holding_ctrl logic in click 2025-10-12 16:11:09 -07:00
Magnus Müller
e69ba30db6 Fix double space 2025-10-12 13:20:27 -07:00
Magnus Müller
301fab0726 Reduce tokens for extract 2025-10-12 13:08:44 -07:00
Magnus Müller
1ac613ca0e Scroll return reduction 2025-10-12 13:08:22 -07:00
Magnus Müller
40a591e4d2 Default function to get coords by backendnode id 2025-10-11 15:48:32 -07:00
Magnus Müller
a4e8eebdd1 Wait log 2025-10-11 12:53:43 -07:00
Magnus Müller
f09004ebd5 include todo in files 2025-10-11 10:52:44 -07:00
Magnus Müller
1086a5634c Init 2025-10-09 11:44:07 -07:00
Magnus Müller
78b53a34b7 update tools 2025-10-08 22:16:41 -07:00
Magnus Müller
6944d4a533 Null checks 2025-10-05 20:36:23 -07:00
Magnus Müller
3eed1345c5 Increase descriptions 2025-10-05 19:41:29 -07:00
Magnus Müller
6d941a5dcc Rename Clear existing to clear 2025-10-05 19:32:39 -07:00
Magnus Müller
84b07cce8c Update parameter dict 2025-10-05 15:24:37 -07:00
Magnus Müller
90d414042a Update docs 2025-10-05 15:09:35 -07:00
Magnus Müller
47bf973285 Default value for extract_links 2025-10-05 13:46:31 -07:00
Magnus Müller
f0acb6b338 Replace tool names like go_to_url wtih navigate 2025-10-05 13:31:38 -07:00
Magnus Müller
50f97000e4 file parameter naming 2025-10-05 13:21:14 -07:00
Magnus Müller
ae3b2a5926 Remove descripitons 2025-10-05 13:06:19 -07:00
Magnus Müller
1248c07e83 Remove descripitons 2025-10-05 13:02:43 -07:00
Magnus Müller
ad9b174762 Fix param 2025-10-05 12:18:21 -07:00
Magnus Müller
18b7dd95a4 Fix param 2025-10-05 12:16:13 -07:00
Magnus Müller
55d10605fd Shorter tools 2025-10-05 11:59:12 -07:00
Magnus Müller
7b995b7fc1 Refactor action field descriptions in AgentOutput models
- Removed redundant description from action field in AgentOutput and its subclasses.
- Updated action extraction documentation in Tools to clarify usage and limitations.
- Enhanced search_engine field description in SearchAction for better clarity on default behavior.
2025-10-05 11:29:19 -07:00
Magnus Müller
22acf58424 Shorter tools 2025-10-05 11:22:54 -07:00
Magnus Müller
9a655e56c5 Shorter tool description 2025-10-05 11:09:15 -07:00
Magnus Müller
461bce7b22 Request screenshot 2025-10-03 23:55:15 -07:00
mertunsall
025eb60e5f try to make actions shorter 2025-10-03 19:00:41 +02:00
Magnus Müller
022a3e352f More robust switch and close tab 2025-09-22 18:04:29 -07:00
Magnus Müller
1fa91b60ee Simplify search function 2025-09-22 17:57:28 -07:00
Magnus Müller
c31ff14c99 Fix multiscroll 2025-09-22 16:23:47 -07:00
Magnus Müller
fb24117363 Lint 2025-09-19 23:52:38 -07:00
Magnus Müller
6f2b8a8947 Update browser_use/tools/service.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-09-18 17:14:47 -07:00
Magnus Müller
a4c83bdbd4 Update syntax rules in service.py to clarify JavaScript execution guidelines and improve example descriptions for better user understanding. 2025-09-18 16:59:07 -07:00