Added errors for unknown actions

This commit is contained in:
Dillon DuPont
2025-08-19 16:20:19 -04:00
parent c4117d015c
commit 5225de8d88

View File

@@ -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"))