From 5225de8d88efbda90e805e3ee78b08dc33459c5b Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Tue, 19 Aug 2025 16:20:19 -0400 Subject: [PATCH] Added errors for unknown actions --- libs/python/agent/agent/agent.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/agent/agent.py index 0428b797..78fc3f45 100644 --- a/libs/python/agent/agent/agent.py +++ b/libs/python/agent/agent/agent.py @@ -459,8 +459,7 @@ class ComputerAgent: assert_callable_with(computer_method, **action_args) await computer_method(**action_args) else: - print(f"Unknown computer action: {action_type}") - return [] + raise ToolError(f"Unknown computer action: {action_type}") # Take screenshot after action if self.screenshot_delay and self.screenshot_delay > 0: @@ -507,7 +506,7 @@ class ComputerAgent: # Perform function call function = self._get_tool(item.get("name")) if not function: - raise ValueError(f"Function {item.get("name")} not found") + raise ToolError(f"Function {item.get("name")} not found") args = json.loads(item.get("arguments"))