From 6ec083e28a0cec6ad381206fad0614939c257497 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Thu, 28 Aug 2025 19:21:04 -0400 Subject: [PATCH] Removed reasoning pass --- .../agent/callbacks/operator_validator.py | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/libs/python/agent/agent/callbacks/operator_validator.py b/libs/python/agent/agent/callbacks/operator_validator.py index 94b81f85..56a9c280 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