This commit is contained in:
Sushant Kumar 2026-11-06 15:51:12 -05:00 • committed by GitHub
commit 8d939efca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -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=[],
)

View file

@ -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).