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.

Removed reasoning pass

Dillon DuPont6ec083e28a0c
diff --git a/libs/python/agent/agent/callbacks/operator_validator.py b/libs/python/agent/agent/callbacks/operator_validator.py
index 94b81f85c5..56a9c2806d 100644
--- a/libs/python/agent/agent/callbacks/operator_validator.py
+++ b/libs/python/agent/agent/callbacks/operator_validator.py
@@ -102,37 +102,37 @@ class OperatorNormalizerCallback(AsyncCallbackHandler):
_keep_keys(action, keep)
- # Second pass: if an assistant message is immediately followed by a computer_call,
- # replace the assistant message itself with a reasoning message with summary text.
- if isinstance(output, list):
- for i, item in enumerate(output):
- # AssistantMessage shape: { type: 'message', role: 'assistant', content: OutputContent[] }
- if item.get("type") == "message" and item.get("role") == "assistant":
- next_idx = i + 1
- if next_idx >= len(output):
- continue
- next_item = output[next_idx]
- if not isinstance(next_item, dict):
- continue
- if next_item.get("type") != "computer_call":
- continue
- contents = item.get("content") or []
- # Extract text from OutputContent[]
- text_parts: List[str] = []
- if isinstance(contents, list):
- for c in contents:
- if isinstance(c, dict) and c.get("type") == "output_text" and isinstance(c.get("text"), str):
- text_parts.append(c["text"])
- text_content = "\n".join(text_parts).strip()
- # Replace assistant message with reasoning message
- output[i] = {
- "type": "reasoning",
- "summary": [
- {
- "type": "summary_text",
- "text": text_content,
- }
- ],
- }
+ # # Second pass: if an assistant message is immediately followed by a computer_call,
+ # # replace the assistant message itself with a reasoning message with summary text.
+ # if isinstance(output, list):
+ # for i, item in enumerate(output):
+ # # AssistantMessage shape: { type: 'message', role: 'assistant', content: OutputContent[] }
+ # if item.get("type") == "message" and item.get("role") == "assistant":
+ # next_idx = i + 1
+ # if next_idx >= len(output):
+ # continue
+ # next_item = output[next_idx]
+ # if not isinstance(next_item, dict):
+ # continue
+ # if next_item.get("type") != "computer_call":
+ # continue
+ # contents = item.get("content") or []
+ # # Extract text from OutputContent[]
+ # text_parts: List[str] = []
+ # if isinstance(contents, list):
+ # for c in contents:
+ # if isinstance(c, dict) and c.get("type") == "output_text" and isinstance(c.get("text"), str):
+ # text_parts.append(c["text"])
+ # text_content = "\n".join(text_parts).strip()
+ # # Replace assistant message with reasoning message
+ # output[i] = {
+ # "type": "reasoning",
+ # "summary": [
+ # {
+ # "type": "summary_text",
+ # "text": text_content,
+ # }
+ # ],
+ # }
return output