litellm/tests/test_litellm/proxy/proxy_server
Yassin Kortam 2cf88d9a37
fix(proxy): send SSE keepalives on assistants runs and A2A streams (#37368)
Both surfaces wrote zero bytes for the whole time-to-first-token, so an
intermediary with an idle read timeout drops a healthy connection before the
first token. They reached neither keepalive engine, which is what #37322 left
open.

The streaming assistants run spends that wait inside the awaited call that
produces its response, since create_response buffers the first chunk, so it
takes the same open_sse_before_first_byte seam the native routes use. The A2A
route only contacts the upstream agent once its body iterator is first pulled,
so nothing is awaited before the response exists and the gap has to be filled
from inside the stream instead; wrap_sse_stream_with_keepalive_pings already
does that and now takes the filler as a parameter, so A2A gets an SSE comment
its JSON-RPC clients discard rather than Anthropic's ping event.

Off until an operator sets litellm_settings.sse_keepalive_ping_interval_seconds.
2026-08-18 16:22:05 -07:00
..
.coverage_baseline
__init__.py
_coverage_check.py
_pin_check.py
conftest.py
test_background_health.py
test_exception_handlers.py
test_harness_smoke.py
test_lifecycle.py
test_openapi_customization.py
test_proxy_config.py
test_routes_anthropic_beta.py
test_routes_assistants.py
test_routes_audio.py
test_routes_chat_completions.py
test_routes_completions.py
test_routes_config.py
test_routes_embeddings.py
test_routes_invitation.py
test_routes_login_sso.py
test_routes_misc.py
test_routes_model_cost_map.py
test_routes_model_info.py
test_routes_model_metrics.py
test_routes_models.py
test_routes_moderations.py
test_routes_onboarding.py
test_routes_queue.py
test_routes_threads.py
test_routes_utils.py
test_spend_counters.py
test_streaming_helpers.py
test_team_model_name_translation.py