litellm/tests/unit/responses
Mateo Wang c143954493
fix(streaming): report the deployment's api_base when a stream fails mid-way (#47045)
* fix(streaming): report the deployment's api_base when a stream fails mid-way

* fix(responses): report the deployment's api_base when a native responses stream fails mid-way

* fix(streaming): name the deployment's configured api_base in mid-stream errors and keep prompt text out

Mid-stream errors on chat and native /v1/responses streams now prefer the router's configured api_base over the logged request URL, websocket turns keep the connection's api_base, and the mid-stream mapping no longer adds the prompt to the debug info.

* fix(streaming): keep api_base credentials out of error debug info and leave websocket turn logging unchanged

* fix(streaming): name the websocket connection's api_base on turn failures and strip scheme-less userinfo

* fix(streaming): strip api_base userinfo before cutting the query so a raw ? or # in a password stays out

Adds the audit's integration tests for the mid-stream alert API Base line and the SDK debug info.

* fix(streaming): leave the API Base line out when an @ follows the host

A raw / ? or # in a password and an @ in a query or path read the same in a malformed api_base, so either guess could show a secret or a wrong host.

* fix(streaming): keep the API Base line when an @ sits in a provider path

Vertex partner model ids like claude-opus-5-5@default put an @ in the URL path, so the fail-closed rule left out the line main printed. The line is now left out only when the text before the first / ? or # is not a host, and a :// counts as the scheme only after a valid scheme name.

* test(streaming): cover a numeric password with a slash in the API Base line

The audit found that a password like 1234/function-secret, which looks like a port, had no case. The line is left out on this branch and printed the raw secret on main
2026-10-17 15:41:24 +00:00
..
litellm_completion_transformation fix(responses): log and bill every round of non-stream MCP auto-execute (#43667) 2026-10-16 17:37:33 +00:00
mcp fix(responses): log and bill every round of non-stream MCP auto-execute (#43667) 2026-10-16 17:37:33 +00:00
__init__.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_additional_tools.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_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_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(databricks): send a single plain text block as a string for non-Claude models (#45686) 2026-10-14 09:22:02 +00:00
test_responses_api_lifecycle.py test: make 77 legacy live tests offline in litellm_utils, router_unit and responses dirs (#45298) 2026-10-08 02:37:55 -07:00
test_responses_api_request_body.py fix(bedrock_mantle): send OpenAI explicit prompt cache breakpoints for GPT-5.6 and newer (#38729) 2026-10-08 02:07:22 -07:00
test_responses_prompt_management.py fix(responses): propagate cache_control through responses->chat completion bridge (#32511) 2026-10-14 15:44:34 -07:00
test_responses_router_cooldown.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_responses_streaming_iterator.py test(unit): wait on the work itself instead of fixed sleeps (#46261) 2026-10-13 12:41:06 -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 refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_responses_websocket_all_providers.py fix(responses): write one spend-log row per native WebSocket turn (#46768) 2026-10-15 19:05:22 -07:00
test_rust_bridge_websocket.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_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): open faked stream items empty so tool arguments and text arrive once (#46533) 2026-10-15 09:35:12 -07:00
test_streaming_iterator_error_events.py fix(streaming): report the deployment's api_base when a stream fails mid-way (#47045) 2026-10-17 15:41:24 +00:00
test_text_format_conversion.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00