litellm/tests/unit/llms/base_llm
Rick 047b4f9a9a
fix(responses): preserve incomplete status in synthetic streams (#52489)
* fix(responses): preserve incomplete status in synthetic streams

Emit response.incomplete when a synthetic stream replays a truncated
response, and finalize both terminal event types in the mock and cached
iterators so usage and success callbacks still run. Incomplete responses
stay out of the response cache.

Co-Authored-By: AaronHowell <111272993+AaronHowell@users.noreply.github.com>

* fix(responses): read response.incomplete where streams end cut off

A replayed Responses stream now ends a cut-off answer with
response.incomplete, so every reader that only knew response.completed
has to accept it too. The Admin UI chat, litellm.harness usage, Langfuse
OTEL output, guardrail-blocked usage and the WebSocket Presidio unmask now
read both events

A replayed cut-off answer is still written to the response cache, as it
was before the terminal event changed. Provider streams still skip it

* fix(responses): mask a cut-off WebSocket answer and test the BigModel JSON replay

The WebSocket output mask only read response.completed, so a cut-off answer
reached the client with Presidio-restored or model-written PII unmasked. It
now reads both terminal events. The output-mask test runs for both terminal
types, and a new BigModel test replays one JSON answer through
litellm.responses and aresponses for a finished and a cut-off body

* fix(interactions): report a cut-off streamed answer as incomplete

The Interactions bridge only read response.completed, so a stream that ends
with response.incomplete closed through the end-of-stream fallback with status
completed. It now reads both terminal events and passes the status on, which
matches what the same request returns without stream

---------

Co-authored-by: AaronHowell <111272993+AaronHowell@users.noreply.github.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-19 22:24:50 -08:00
..
audio_transcription
auth ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
batches fix(bedrock): derive the web identity session policy per AWS caller (#50592) 2026-11-08 19:13:53 +00:00
chat feat(sarvam): send a litellm User-Agent on chat requests (#52012) 2026-11-17 23:52:53 +00:00
decisions feat(decisions): add Parallel AI web-grounded decisions (#49188) 2026-11-03 04:47:02 +00:00
embedding fix(embeddings): unwrap extra_body for providers with their own embedding handlers (#51335) 2026-11-12 15:41:50 -08:00
files
guardrail_translation fix(responses): preserve incomplete status in synthetic streams (#52489) 2026-11-19 22:24:50 -08:00
harness
realtime
rerank
responses fix(router): prevent Responses fallback from replaying delivered tool calls (#51683) 2026-11-13 11:43:03 -08:00
search
vector_store
__init__.py
test_base_managed_resource.py
test_base_model_iterator.py fix(streaming): exact-match the SSE [DONE] marker in BaseModelResponseIterator (#47832) 2026-10-28 05:21:31 -07:00
test_base_utils.py fix(llms): move later developer messages for models declared system-first (#48897) 2026-10-29 04:12:13 -07:00
test_managed_resource_isolation.py
test_managed_resources_utils.py