mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(responses): bill a client-cancelled native Responses stream with the usage the provider reports
When a client leaves a native /v1/responses stream, keep reading the provider's stream to its terminal event so the spend log carries the provider's own usage (reasoning tokens and the cached split included), including when the client left before any output. cancel_on_disconnect keeps cancelling the upstream call
Resolves LIT-10916
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor(responses): name the check for a stream that can be read on after its consumer left
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* test(proxy): assert the budget reservation is not refunded while a cancelled Responses stream is read on
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(responses): keep a provider event that arrived just as the consumer was cancelled
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(responses): let the success event of an already finished stream own the disconnect cleanup
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(responses): leave the slot to the failure a cut stream logged while it was read on
A provider failure during the disconnect drain is logged by the stream, and the legacy
limiter's failure callback already released the parallel-request slot, so the cleanup's
explicit release freed a second one. The cleanup now skips that release and settles the
reservation, which no failure hook does for a request whose client left
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* Revert "fix(responses): leave the slot to the failure a cut stream logged while it was read on"
This reverts commit
|
||
|---|---|---|
| .. | ||
| litellm_completion_transformation | ||
| mcp | ||
| __init__.py | ||
| test_additional_tools.py | ||
| test_custom_tool_call.py | ||
| test_input_items_query.py | ||
| test_instructions_length.py | ||
| test_metadata_codex_callback.py | ||
| test_no_duplicate_spend_logs.py | ||
| test_null_test_fix.py | ||
| test_responses_api_bridge_flag.py | ||
| test_responses_api_lifecycle.py | ||
| test_responses_api_request_body.py | ||
| test_responses_prompt_management.py | ||
| test_responses_router_cooldown.py | ||
| test_responses_streaming_iterator.py | ||
| test_responses_supported_endpoints_passthrough.py | ||
| test_responses_utils.py | ||
| test_responses_websocket_all_providers.py | ||
| test_rust_bridge_websocket.py | ||
| test_sse_output_recovery.py | ||
| test_streaming_iterator.py | ||
| test_streaming_iterator_error_events.py | ||
| test_text_format_conversion.py | ||