litellm/tests/unit/responses
tavren27 7dfa491ff9
fix(responses): keep sent tool names in cold storage replay and guardrail rewrites (#54240)
* fix(responses): replay cold-stored input calls under the names the provider was sent

* fix(responses): keep guardrail edits to MCP servers sharing a label and show guardrails full tool names

A guardrail that edited one of two MCP servers sharing a server_label and dropped the other made the request fail, because the merge could not tell which server the edit came from. An MCP server's chat form is the server itself, so the edit is sent as returned.

The guardrail messages view for /v1/responses now names namespaced calls by their full name, not the 64-character provider name, so request guardrails see the same names the tool policy checks.

* fix(responses): keep a guardrail's tool edit in its own slot and replay self-named members under their sent name

* fix(responses): place a guardrail's tied tool edit by the order it came back in

When a guardrail edits one of two same-named tools and drops the other, and the edit is as close to both as either is to the other, it now takes the slot that keeps its order around the uniquely named tools the guardrail returned, instead of always the first slot

* fix(responses): replay cold-stored calls under sent names when prompts are not stored

* fix(responses): keep a guardrail's order for same-named tools when it drops one

* fix(responses): bound same-named tool matching so a guardrail edit cannot stall the event loop

* fix(responses): keep content matching for small same-named groups when a large group passes the budget

* fix(responses): keep main's content matching for same-named groups past the scoring budget

A same-named group too large for nearest-match scoring now pairs kept tools with originals in order within each content match, as main does, instead of falling back to position across namespaces

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 05:41:32 +00:00
..
litellm_completion_transformation fix(responses): keep sent tool names in cold storage replay and guardrail rewrites (#54240) 2026-11-25 05:41:32 +00:00
mcp feat(responses): store each bridged turn's path to the root so a fork replays only its ancestors (#49519) 2026-11-23 12:43:11 -08:00
__init__.py
test_additional_tools.py feat(proxy): mixed Codex model picker and LiteLLM routing on native codex routes (#49408) 2026-11-06 11:14:47 -08:00
test_custom_tool_call.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_input_items_query.py fix(proxy): forward limit, order, after, before and include on GET /v1/responses/{id}/input_items (#51259) 2026-11-20 07:54:26 -08:00
test_instructions_length.py fix(responses): send bridged system prompts too long for instructions as input (#52964) 2026-11-20 11:56:47 -08:00
test_metadata_codex_callback.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_no_duplicate_spend_logs.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_null_test_fix.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_responses_api_bridge_flag.py fix(llms): treat chat-latest and gpt-chat-latest as gpt-5 family models (#51151) 2026-11-24 04:02:51 -08:00
test_responses_api_lifecycle.py fix(responses): log the resolved provider on Responses API calls (#52622) 2026-11-18 22:34:16 +00:00
test_responses_api_request_body.py fix(router): count a Responses WebSocket turn's input against deployment ITPM (#53594) 2026-11-24 04:26:36 -08:00
test_responses_prompt_management.py fix(sdk): decide MCP gateway routing without importing the proxy handler (#45961) 2026-10-20 01:44:54 +00:00
test_responses_router_cooldown.py fix(openai): relay provider error codes, types, and Responses params from OpenAI-compatible backends (#51809) 2026-11-24 02:23:00 +00:00
test_responses_streaming_iterator.py fix(responses): resume background response streams with stream and starting_after (#48819) 2026-10-29 02:31:22 -07:00
test_responses_supported_endpoints_passthrough.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_responses_utils.py fix(openai): forward Responses background_options (#53991) 2026-11-23 17:56:11 -08:00
test_responses_websocket_all_providers.py fix(guardrails): scan refusal text in output guardrails on chat and responses (#54039) 2026-11-24 05:27:45 -08:00
test_rust_bridge_websocket.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_sse_output_recovery.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_streaming_iterator.py fix(responses): always stream tool argument fields as strings for every Responses provider (#53953) 2026-11-24 03:45:17 +00:00
test_streaming_iterator_error_events.py fix(openai): relay provider error codes, types, and Responses params from OpenAI-compatible backends (#51809) 2026-11-24 02:23:00 +00:00
test_text_format_conversion.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00