litellm/tests/unit/integrations/otel
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
..
__init__.py
test_db_endpoint.py fix(otel): name postgres service spans by operation and table (#44240) 2026-10-03 09:20:28 -07:00
test_langfuse_logger.py fix(responses): preserve incomplete status in synthetic streams (#52489) 2026-11-19 22:24:50 -08:00
test_otel_v2_baggage.py fix(otel): emit OpenInference tool calls and metadata on Arize OTel v2 spans (#43698) 2026-10-08 15:53:07 -07:00
test_otel_v2_components.py feat(control_plane): ocsf audit events, sink protocol, queued delivery and hash chain (#49660) 2026-11-16 17:36:24 +00:00
test_otel_v2_config_baggage_parenting_guardrails.py fix(otel): tolerate non-dict callback_settings.otel and ignore bare EXCLUDED_SERVICES env (#44086) 2026-10-02 12:36:46 -07:00
test_otel_v2_destinations.py fix(otel v2): stop legacy langfuse loggers sending to refused key/team hosts (#51344) 2026-11-16 11:34:20 -08:00
test_otel_v2_dynamic.py fix(otel): send the Langfuse environment, release and version on OTel v2 (#51385) 2026-11-14 11:40:35 -08:00
test_otel_v2_emitter.py fix(langfuse otel): emit request metadata under langfuse.observation.metadata and langfuse.trace.metadata on the OTEL v2 Langfuse mapper (#42697) 2026-10-27 18:54:10 -07:00
test_otel_v2_logger.py fix(otel): emit a span for every failed retry and fallback attempt (#50310) 2026-11-17 14:38:25 -08:00
test_otel_v2_metrics.py fix(otel): label configured pass-through routes litellm.passthrough and read the operation from the upstream (#48675) 2026-10-28 10:48:34 -07:00
test_otel_v2_mount.py fix(otel): suppress spans for excluded proxy requests (#48720) 2026-10-28 11:24:34 -07:00
test_otel_v2_multibackend.py
test_otel_v2_presets.py fix(ci): unblock dependency security checks (#48055) 2026-10-23 14:05:46 -07:00
test_otel_v2_sources_of_truth.py fix(otel): send the Langfuse environment, release and version on OTel v2 (#51385) 2026-11-14 11:40:35 -08:00
test_otel_v2_vendor_mappers.py fix(otel): send the Langfuse environment, release and version on OTel v2 (#51385) 2026-11-14 11:40:35 -08:00
test_runtime.py feat(otel): trace auto-router configuration and classifier failures (#44926) 2026-10-06 15:40:34 -07:00