Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

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

cgutierr77922c92fc99
diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/agent/agent.py
index 0b9f243aaf..a36ef8766a 100644
--- a/libs/python/agent/agent/agent.py
+++ b/libs/python/agent/agent/agent.py
@@ -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"}