fix(router): handle empty tools list in stream fallbacks

This commit is contained in:
vanika02 2026-07-13 10:34:07 +00:00
parent 3deba7a02f
commit 0257c80fb0

View file

@ -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: