Files
litellm/tests/llm_responses_api_testing
Sameer Kankute 21a21e01f7 fix(responses): use OpenAI SSEDecoder for Responses API streaming (#28566)
* fix(responses): use OpenAI SSEDecoder for Responses API streaming

httpx aiter_lines() uses str.splitlines(), which splits on U+2028 inside
JSON payloads and silently drops response.completed (no spend log). Use
openai._streaming.SSEDecoder (bytes.splitlines before decode) instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(responses): drop redundant SSE prefix strip after SSEDecoder switch

SSEDecoder already strips the 'data:' field prefix from each event, so the
extra call to _strip_sse_data_from_chunk on sse.data was redundant and could
incorrectly mangle payloads whose actual content starts with 'data:'.

Co-authored-by: Yassin Kortam <yassin@berri.ai>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Yassin Kortam <yassin@berri.ai>
2026-05-22 10:03:36 -07:00
..
2026-03-28 19:17:38 -07:00