From 976f7ca280223dcefd2302076f368a12c4737bab Mon Sep 17 00:00:00 2001 From: mateo Date: Wed, 21 Oct 2026 09:01:37 +0000 Subject: [PATCH] Revert "fix(messages): drop stream_timeout once native folds it into timeout so streams stay on Rust" This reverts commit 487242006acef5f0b9fd9fc999f30d0c92a6e618. --- litellm/messages/dispatch.py | 2 +- tests/test_litellm_rust/messages/test_dispatch.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/litellm/messages/dispatch.py b/litellm/messages/dispatch.py index 9c87f8c6bcd..59e02474c21 100644 --- a/litellm/messages/dispatch.py +++ b/litellm/messages/dispatch.py @@ -58,7 +58,7 @@ def _native_kwargs(fields: Mapping[str, object], kwargs: Mapping[str, object]) - stream_timeout: Final = kwargs.get("stream_timeout") if fields.get("stream") is not True or stream_timeout is None: return kwargs - return {**{key: value for key, value in kwargs.items() if key != "stream_timeout"}, "timeout": stream_timeout} + return {**kwargs, "timeout": stream_timeout} def _public_request( diff --git a/tests/test_litellm_rust/messages/test_dispatch.py b/tests/test_litellm_rust/messages/test_dispatch.py index 7b52fb5c23f..dbd4e5a0b3a 100644 --- a/tests/test_litellm_rust/messages/test_dispatch.py +++ b/tests/test_litellm_rust/messages/test_dispatch.py @@ -189,10 +189,7 @@ def test_native_streams_are_bounded_by_stream_timeout(stream: bool, expected_tim python=python, binding=messages_binding(native), native=lambda hook, request, call_args, call_kwargs: hook(request), - rules=( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=MESSAGES_PYTHON_FEATURES), - RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), - ), + rules=RUST_RULES, ) assert captured[0].resolved["timeout"] == expected_timeout