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
..
base_responses_api.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
conftest.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
test_anthropic_responses_api.py Litellm oss staging 1 (#28337) 2026-05-20 17:27:03 -07:00
test_anthropic_tool_result_empty_call_id.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_anthropic_tool_result_fix.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_azure_responses_api.py test: test 2026-03-28 19:17:38 -07:00
test_base_responses_api_streaming_iterator.py fix(responses): use OpenAI SSEDecoder for Responses API streaming (#28566) 2026-05-22 10:03:36 -07:00
test_google_ai_studio_responses_api.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_responses_api.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_responses_hooks.py test: include response key in response.completed chunk for ID hook test 2026-05-01 15:41:17 +05:30