From 0257c80fb0923c3ea66aa535751de36930788c98 Mon Sep 17 00:00:00 2001 From: vanika02 Date: Mon, 13 Jul 2026 10:34:07 +0000 Subject: [PATCH] fix(router): handle empty tools list in stream fallbacks --- litellm/router.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index e158521bff8..ab9ed2337e7 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -1994,7 +1994,7 @@ class Router: if ( e.is_pre_first_chunk or not e.generated_content - or initial_kwargs.get("tools") + or initial_kwargs.get("tools") is not None ): # Retry with the original messages when: # - no content was generated before the error @@ -2555,7 +2555,7 @@ class Router: if ( e.is_pre_first_chunk or not e.generated_content - or initial_kwargs.get("tools") + or initial_kwargs.get("tools") is not None ): initial_kwargs["messages"] = messages else: