litellm/tests/test_litellm/llms/openai
Yassin Kortam cb3a7accdd
fix(streaming): surface in-body error payloads on OpenAI-compatible streams (#32237)
* fix(streaming): surface in-body error payloads on OpenAI-compatible streams

vLLM and sglang return HTTP 200 streams whose SSE body carries the error,
e.g. data: {"error": {"message": "...", "code": 400}}. The OpenAI-compatible
chunk parser had no detection for this shape: since #23931 the payload parsed
into an empty chunk (choices=[]) and the stream ended silently with 200,
losing the provider's error and never attempting configured fallbacks.

Detect the payload in OpenAIChatCompletionStreamingHandler.chunk_parser and
raise OpenAIError with the upstream message and status code. The existing
mid-stream gate then applies: 4xx surface directly to the client, 5xx wrap
into MidStreamFallbackError so the router can run configured fallbacks.

Fixes #25492

* fix(streaming): serialize messageless error payloads as JSON

Address review feedback: an error dict without a message field now
serializes via json.dumps instead of Python dict repr
2026-07-06 08:13:25 -07:00
..
chat fix(streaming): surface in-body error payloads on OpenAI-compatible streams (#32237) 2026-07-06 08:13:25 -07:00
completion Litellm oss 090626 (#30021) 2026-06-10 10:34:07 -07:00
embeddings/guardrail_translation style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
evals fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
image_generation test(image_generation): add tests for extra_headers propagation 2026-02-25 01:51:18 +08:00
realtime feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
responses fix(responses): presidio PII masking for Azure WebSocket and streaming (#30003) 2026-06-12 07:27:03 -07:00
speech fix(unified_guardrail.py): support during_call event type for unified guardrails (#17514) 2025-12-04 22:06:13 -08:00
transcriptions chore: litellm oss staging (#31185) 2026-06-26 09:17:44 -07:00
vector_store_files fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
vector_stores fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
videos fix(videos): encode the variant query param 2026-05-01 00:32:02 +00:00
test_data_residency.py feat(openai): apply regional-processing cost uplift for EU/US data residency (#28626) 2026-05-25 20:36:14 -07:00
test_gpt5_transformation.py Fix GPT-5 reasoning summary strip test path 2026-05-11 06:01:35 +00:00
test_is_model_gpt_5_model.py feat(proxy): add /v1/memory CRUD endpoints (#26218) 2026-04-24 18:38:07 -07:00
test_o_series_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_common_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_empty_response.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_file_content_streaming.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_image_edit_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_use_chat_completions_api_no_leak.py fix: stop use_chat_completions_api flag from leaking into provider request body (#29447) 2026-06-01 14:04:42 -07:00