mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(openai_like): end an async stream cleanly when the connection drops after the finish The async SSE reader wrapped every read error in a bare RuntimeError, so the stream wrapper's rule that ends a stream cleanly on an httpx ReadError or RemoteProtocolError after a finish_reason never matched. Catch only ValueError, as the sync reader does, so transport errors reach that rule unchanged * test(databricks): name the RuntimeError wrap tests for the ValueError they raise * fix(streaming): warn when an upstream drop after the finish ends the stream * fix(logging): classify httpx network errors as provider connection errors A stream drop before the finish now reaches failure logging as a raw httpx.ReadError. With the httpx transport its message is empty, so normalized_error fell to UNCLASSIFIED where main reported an internal state error. Map httpx NetworkError and RemoteProtocolError to 500_PROVIDER_CONNECTION_ERROR, which the aiohttp transport already gets from the message. The after-finish integration test now also asserts that no error event reaches the client. --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| faked_responses_case.py | ||
| test_assistants_evals_stream.py | ||
| test_azure_streaming_function_calls.py | ||
| test_background_response_polling_cancel.py | ||
| test_bedrock_guardrail_background_stream_scan.py | ||
| test_chat_stream_guardrail_error_events.py | ||
| test_decision_model_buffering.py | ||
| test_decision_model_pipeline_buffering.py | ||
| test_fake_stream_reasoning_wire.py | ||
| test_faked_responses_stream_bridges.py | ||
| test_faked_responses_stream_cache_replay.py | ||
| test_faked_responses_stream_chaos.py | ||
| test_faked_responses_stream_guardrail_blocks.py | ||
| test_faked_responses_stream_items.py | ||
| test_file_content_streaming.py | ||
| test_google_genai_stream_usage_settings_wire.py | ||
| test_interception_converted_stream_options.py | ||
| test_live_disconnect_failure_callback.py | ||
| test_mid_stream_fallback_continuation.py | ||
| test_noma_v2_streaming_settings.py | ||
| test_openai_like_stream_usage_wire.py | ||
| test_openai_sdk_plain_chunk_fields.py | ||
| test_openai_stream_passthrough_fields.py | ||
| test_responses_bridge_stream_chaos.py | ||
| test_responses_bridge_stream_errors.py | ||
| test_responses_stream_tool_argument_strings.py | ||
| test_responses_top_level_error_events.py | ||
| test_stream_clean_eof_without_finish_reason.py | ||
| test_stream_contracts.py | ||
| test_stream_open_error_provider_headers_proxy.py | ||
| test_stream_parallel_slot_release.py | ||
| test_text_completion_stream_guardrail_rebuild.py | ||
| test_ttft_keepalive.py | ||