litellm/tests/integration/streaming
rhea-tk 65c8ce23f5
fix(proxy): send finish_reason null on every in-progress streamed chat chunk (#53876)
* fix(proxy): send finish_reason null on every streamed chat chunk

The proxy's chat completions stream left the finish_reason key out of every
in-progress chunk, while OpenAI and Mistral send "finish_reason": null until the
last one. The mistralai SDK marks the field required-nullable, so its clients
failed on the first chunk. Both the fast and the slow chunk serializer now write
the key on every choice, and every other None field stays omitted as before

* fix(proxy): send NaN and Infinity in streamed chat chunks as null

Chunks with a null finish_reason go through to_json, which wrote bare NaN and -Infinity where model_dump_json wrote null, so strict JSON parsers rejected a chunk carrying a -inf logprob. Both the to_json path and its json.dumps fallback now write null.

* test(integration): expect finish_reason null on in-progress chat chunks

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-26 08:08:44 +00:00
..
faked_responses_case.py fix(responses): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_assistants_evals_stream.py test(integration): pin assistants and evals endpoint contracts (#44734) 2026-10-14 07:08:35 +00:00
test_azure_streaming_function_calls.py test: migrate local_testing SDK and provider tests out of build_and_test (#45760) 2026-10-10 23:14:25 +00:00
test_background_response_polling_cancel.py fix(responses): stop the background stream when a polling response is cancelled (#49384) 2026-11-18 14:33:39 +00:00
test_bedrock_guardrail_background_stream_scan.py feat(guardrails): scan sampled stream windows in the background (#48952) 2026-10-29 12:19:39 -07:00
test_chat_stream_guardrail_error_events.py test(streaming): assert queued first-error JSON response (#51849) 2026-11-14 19:12:33 +00:00
test_decision_model_buffering.py fix(streaming)!: fail a stream that ends without a finish reason (#47665) 2026-10-31 11:29:26 -07:00
test_decision_model_pipeline_buffering.py fix(guardrails): honor decision model streaming buffering (#46086) 2026-10-12 16:28:22 -07:00
test_fake_stream_reasoning_wire.py fix(bedrock)!: keep reasoning, thinking blocks and the json_mode finish_reason on fake streams (#46863) 2026-10-16 17:27:57 +00:00
test_faked_responses_stream_bridges.py fix(responses): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_faked_responses_stream_cache_replay.py fix(responses): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_faked_responses_stream_chaos.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_faked_responses_stream_guardrail_blocks.py fix(responses): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_faked_responses_stream_items.py fix(responses): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_file_content_streaming.py
test_google_genai_stream_usage_settings_wire.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_interception_converted_stream_options.py fix(agentic)!: surface a failed agentic follow-up call instead of the pre-loop tool call (#49227) 2026-11-04 02:00:33 +00:00
test_live_disconnect_failure_callback.py fix(streaming): preserve failure context without retaining requests (#52408) 2026-11-18 06:18:22 +00:00
test_mid_stream_fallback_continuation.py feat(router): mid-stream fallback continuation for chat completions (#41127) 2026-10-16 13:51:32 +00:00
test_noma_v2_streaming_settings.py test(streaming): make unbuffered Noma secret exposure deterministic (#51707) 2026-11-13 21:25:53 +00:00
test_openai_like_stream_usage_wire.py fix(openai_like): end an async stream cleanly when the connection drops after the finish (#54565) 2026-11-26 07:48:41 +00:00
test_openai_sdk_plain_chunk_fields.py fix(proxy): send finish_reason null on every in-progress streamed chat chunk (#53876) 2026-11-26 08:08:44 +00:00
test_openai_stream_passthrough_fields.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
test_responses_bridge_stream_chaos.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_responses_bridge_stream_errors.py fix(proxy)!: preserve Responses SSE event framing (#47980) 2026-11-06 20:17:57 -08:00
test_responses_stream_tool_argument_strings.py fix(responses): always stream tool argument fields as strings for every Responses provider (#53953) 2026-11-24 03:45:17 +00:00
test_responses_top_level_error_events.py test(responses): expect the provider's flex_unavailable code on stream errors (#54112) 2026-11-24 08:23:20 +00:00
test_stream_clean_eof_without_finish_reason.py test(integration): update two spend tests left stale by the rust spend log writer (#53363) 2026-11-21 12:01:35 -08:00
test_stream_contracts.py fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116) 2026-11-16 20:44:27 -08:00
test_stream_open_error_provider_headers_proxy.py test(integration): hand every harness server a port from one per-worker block (#46761) 2026-10-15 16:56:40 -07:00
test_stream_parallel_slot_release.py
test_text_completion_stream_guardrail_rebuild.py fix(guardrails): scan and rewrite streamed /v1/completions under post_call guardrails (#49035) 2026-10-29 08:46:49 -07:00
test_ttft_keepalive.py