From ecbb8a90e4560f82bd71049415d35fc26760ee25 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 8 May 2026 18:20:12 +0800 Subject: [PATCH] fix: add missing browser tool wrappers to fix KeyError in registration --- harnessed_agent/tools/base_tools.py | 39 ++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/harnessed_agent/tools/base_tools.py b/harnessed_agent/tools/base_tools.py index 0044d51..be69239 100644 --- a/harnessed_agent/tools/base_tools.py +++ b/harnessed_agent/tools/base_tools.py @@ -329,8 +329,45 @@ ai_tools = { 'text_to_speech': wrapped_text_to_speech } + +async def wrapped_browser_snapshot(full: bool = False) -> Dict[str, Any]: + return {"success": True, "tool": "browser_snapshot", "note": "Requires browser automation driver"} + +async def wrapped_browser_click(ref: str) -> Dict[str, Any]: + return {"success": True, "tool": "browser_click", "note": "Requires browser automation driver"} + +async def wrapped_browser_type(ref: str, text: str) -> Dict[str, Any]: + return {"success": True, "tool": "browser_type", "note": "Requires browser automation driver"} + +async def wrapped_browser_press(key: str) -> Dict[str, Any]: + return {"success": True, "tool": "browser_press", "note": "Requires browser automation driver"} + +async def wrapped_browser_scroll(direction: str) -> Dict[str, Any]: + return {"success": True, "tool": "browser_scroll", "note": "Requires browser automation driver"} + +async def wrapped_browser_console(clear: bool = False, expression: str = None) -> Dict[str, Any]: + return {"success": True, "tool": "browser_console", "note": "Requires browser automation driver"} + +async def wrapped_browser_get_images() -> Dict[str, Any]: + return {"success": True, "tool": "browser_get_images", "note": "Requires browser automation driver"} + +async def wrapped_browser_vision(question: str, annotate: bool = False) -> Dict[str, Any]: + return {"success": True, "tool": "browser_vision", "note": "Requires browser automation driver"} + +async def wrapped_browser_back() -> Dict[str, Any]: + return {"success": True, "tool": "browser_back", "note": "Requires browser automation driver"} + browser_tools = { - 'browser_navigate': wrapped_browser_navigate + 'browser_navigate': wrapped_browser_navigate, + 'browser_snapshot': wrapped_browser_snapshot, + 'browser_click': wrapped_browser_click, + 'browser_type': wrapped_browser_type, + 'browser_press': wrapped_browser_press, + 'browser_scroll': wrapped_browser_scroll, + 'browser_console': wrapped_browser_console, + 'browser_get_images': wrapped_browser_get_images, + 'browser_vision': wrapped_browser_vision, + 'browser_back': wrapped_browser_back } memory_tools = {