Problem
The Realtime endpoint emits response deltas, per-modality done events, and response.done, but omits the standard per-item lifecycle events:
response.output_item.added
response.content_part.added
response.content_part.done
response.output_item.done
The official Realtime text lifecycle places these events around response.output_text.delta / response.output_text.done and before response.done. The response.output_item.done reference also specifies that it is emitted when a response is interrupted, incomplete, or cancelled.
This omission predates #453. Ordered multi-item responses make it more visible because a client waiting for item completion only discovers the final items inside response.done.
Expected behavior
Emit the standard lifecycle for every assistant message or function-call output item while preserving the stable item IDs and response-wide output_index values already used by the endpoint.
Acceptance criteria
- Emit
response.output_item.added when each response output item begins.
- Emit
response.content_part.added before streaming a message content part and response.content_part.done after its modality-specific done event.
- Emit
response.output_item.done after every item completes, including items exposed before interruption, incomplete completion, or cancellation.
- Emit
response.done only after all applicable item/content lifecycle events.
- Keep IDs and output indexes consistent across lifecycle events and
response.done.output.
- Add WebSocket and WebRTC protocol-sequence contract tests covering text,
text → tool → text, and cancellation.
Problem
The Realtime endpoint emits response deltas, per-modality done events, and
response.done, but omits the standard per-item lifecycle events:response.output_item.addedresponse.content_part.addedresponse.content_part.doneresponse.output_item.doneThe official Realtime text lifecycle places these events around
response.output_text.delta/response.output_text.doneand beforeresponse.done. Theresponse.output_item.donereference also specifies that it is emitted when a response is interrupted, incomplete, or cancelled.This omission predates #453. Ordered multi-item responses make it more visible because a client waiting for item completion only discovers the final items inside
response.done.Expected behavior
Emit the standard lifecycle for every assistant message or function-call output item while preserving the stable item IDs and response-wide
output_indexvalues already used by the endpoint.Acceptance criteria
response.output_item.addedwhen each response output item begins.response.content_part.addedbefore streaming a message content part andresponse.content_part.doneafter its modality-specific done event.response.output_item.doneafter every item completes, including items exposed before interruption, incomplete completion, or cancellation.response.doneonly after all applicable item/content lifecycle events.response.done.output.text → tool → text, and cancellation.