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>
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>
- 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.