[Bugfix][Responses] Use standard reasoning content-part events (#59652)

Signed-off-by: ai-jz <ai-jz@users.noreply.github.com>
Co-authored-by: ai-jz <ai-jz@users.noreply.github.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
ai-jz
2026-10-01 19:20:57 +00:00
committed by GitHub
co-authored by ai-jz Flora Feng
parent d848c4ed3d
commit 2a52715ef7
6 changed files with 59 additions and 85 deletions
@@ -37,7 +37,6 @@ def pairs_of_event_types() -> dict[str, str]:
"response.content_part.done": "response.content_part.added",
"response.output_text.done": "response.output_text.delta",
"response.reasoning_text.done": "response.reasoning_text.delta",
"response.reasoning_part.done": "response.reasoning_part.added",
"response.mcp_call_arguments.done": "response.mcp_call_arguments.delta",
"response.mcp_call.completed": "response.mcp_call.in_progress",
"response.function_call_arguments.done": "response.function_call_arguments.delta", # noqa: E501
@@ -250,11 +249,8 @@ def _validate_field_consistency(events: list) -> None:
active_content_index = None
continue
# --- content_part / reasoning_part added: sets content_index
if etype in (
"response.content_part.added",
"response.reasoning_part.added",
):
# --- content_part added: sets content_index
if etype == "response.content_part.added":
_assert_item_fields(event, etype, active_item_id, active_output_index)
content_index = getattr(event, "content_index", None)
if active_content_index is None: