litellm/tests/unit/llms/base_llm/responses
joshua-berri 3dcc550aae
fix(router): prevent Responses fallback from replaying delivered tool calls (#51683)
* fix(router): stop a Responses fallback from replaying a delivered tool call

A tool-only Responses stream carries no output text, so a retriable error or
response.failed after a completed function call was treated as a failure before
output and the fallback replayed the whole request, running the tool twice.
Check for a started tool call before the before-output shortcut so the primary
error surfaces instead. Pre-output fallback and text continuation are unchanged.

* test(router): read the delivered tool call events one at a time

Consume the created and output_item.done events with anext and expect the
primary error on the next read, so the raises block holds a single statement.

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-11-13 11:43:03 -08:00
..
__init__.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_codex_compat.py fix(bedrock): forward Codex agent messages that carry encrypted content intact (#50457) 2026-11-06 17:47:43 -08:00
test_transformation.py fix(router): prevent Responses fallback from replaying delivered tool calls (#51683) 2026-11-13 11:43:03 -08:00