litellm/tests/unit/llms/litellm_proxy
mika-lt ea51e77dc5
fix(responses)!: keep the proxy's error body on litellm.responses errors from litellm_proxy models (#49073)
* fix(responses): keep the proxy's error body on litellm.responses errors from litellm_proxy models

litellm.responses() with a litellm_proxy/ model raised BadRequestError with
body None when the proxy answered a 4xx, while litellm.completion() on the
same proxy carries the decoded error object. The litellm_proxy Responses
config now decodes the error JSON into the exception body the way the
OpenAI SDK does, so body, code, type and the message match chat completions
on sync, async and streaming calls.

* fix(proxy): relay a downstream proxy's provider_specific_fields in error responses

A LiteLLM proxy routing to another LiteLLM proxy now copies the downstream's
provider_specific_fields (which guardrail fired) from the exception body into
its own error answer, on chat and Responses alike. Adds tests for the two
_openai_sdk_error_body branches the existing tests left open.

* fix(proxy): redact internal details from relayed provider_specific_fields

* fix(proxy): redact relayed provider_specific_fields per key so credential-named values stay hidden

* fix(proxy): redact numeric credentials in relayed provider_specific_fields

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-10-29 17:39:56 -07:00
..
chat fix(llms): move later developer messages for models declared system-first (#48897) 2026-10-29 04:12:13 -07:00
responses fix(responses)!: keep the proxy's error body on litellm.responses errors from litellm_proxy models (#49073) 2026-10-29 17:39:56 -07:00
skills refactor(mcp): drop the experimental label from the MCP server and client paths (#48513) 2026-10-27 17:47:50 +00:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
test_sandbox_executor.py test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
test_skills_ownership.py test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00