diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.py index 33ea85d7d53..3b262f4b11e 100644 --- a/litellm/responses/litellm_completion_transformation/transformation.py +++ b/litellm/responses/litellm_completion_transformation/transformation.py @@ -3642,9 +3642,10 @@ class LiteLLMCompletionResponsesConfig: id=mint_reasoning_item_id(), status=LiteLLMCompletionResponsesConfig._responses_status_for_choice(choice), role="assistant", + summary=[], content=[ OutputText( - type="output_text", + type="reasoning_text", text=text, annotations=[], ) diff --git a/tests/unit/responses/litellm_completion_transformation/test_litellm_completion_responses.py b/tests/unit/responses/litellm_completion_transformation/test_litellm_completion_responses.py index d5860b7519b..d30d57c185b 100644 --- a/tests/unit/responses/litellm_completion_transformation/test_litellm_completion_responses.py +++ b/tests/unit/responses/litellm_completion_transformation/test_litellm_completion_responses.py @@ -314,7 +314,7 @@ class TestLiteLLMCompletionResponsesConfig: assert reasoning_item.status == "completed" assert reasoning_item.role == "assistant" assert len(reasoning_item.content) == 1 - assert reasoning_item.content[0].type == "output_text" + assert reasoning_item.content[0].type == "reasoning_text" assert "step by step" in reasoning_item.content[0].text assert "42" in reasoning_item.content[0].text @@ -5618,6 +5618,16 @@ class TestBridgedOutputItemIdPrefixes: assert not suffix.lstrip("-").isdigit() assert not suffix.startswith("-") + def test_reasoning_item_is_a_responses_reasoning_item(self): + """A client that validates output items (the OpenAI Agents SDK restoring a paused run) + rejected the bridged item: it had no ``summary`` and typed its text ``output_text``.""" + from openai.types.responses import ResponseReasoningItem + + item = ResponseReasoningItem.model_validate(self._reasoning_items()[0].model_dump()) + + assert item.summary == [] + assert [(part.type, part.text) for part in item.content or []] == [("reasoning_text", "thinking about fruit")] + class TestStreamingSnapshotItemIds: """The response.completed snapshot must reuse the streamed item ID (issue #27333).