Dummy (small) models can produce action_types=None, which will later produce a crash, avoid it

This commit is contained in:
cgutierr
2025-08-03 13:04:29 +02:00
parent 9781810451
commit 77922c92fc

View File

@@ -411,6 +411,9 @@ class ComputerAgent:
# Perform computer actions
action = item.get("action")
action_type = action.get("type")
if action_type is None:
print(f"Action type cannot be `None`: action={action}, action_type={action_type}")
return []
# Extract action arguments (all fields except 'type')
action_args = {k: v for k, v in action.items() if k != "type"}