6 views
-/https://github.com/berriai/litellm/issues/25402
GitHub · issue

#25402 [Bug]: /v1/responses/compact fails during router_settings.fallbacks failover — 'Unknown parameter: metadata' (hardcoded 'metadata' key in run_async_fallback)

  • State: open
  • Author: @beveradb
  • Labels: proxy, llm translation

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

`/v1/responses/compact` fails during `router_settings.fallbacks` failover from a primary model to its fallback, with Azure returning `400 Unknown parameter: 'metadata'`. The same failover on `/v1/responses` (non-compact) works correctly and returns 200 from the fallback deployment.

Root cause is in `litellm/router_utils/fallback_event_handlers.py::run_async_fallback` at line 133 (currently identical between tag `v1.82.3` and tip of `main`):

```python kwargs.setdefault("metadata", {}).update( {"model_group": kwargs.get("model", None)} ) # update model_group used, if fallbacks are done ```

This unconditionally writes to the `"metadata"` key in kwargs. For Responses API routes (paths containing `"responses"` per `LITELLM_METADATA_ROUTES` in `litellm/proxy/litellm_pre_call_utils.py:65-70`), the proxy's correct metadata-variable name is `"litellm_metadata"`, not `"metadata"`. The fallback path writes a top-level `"metadata"` dict into kwargs that then gets forwarded as a request-body parameter to the upstream provider. Azure OpenAI's v1-compat `/responses/compact` endpoin…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d19h12m37s ago — entered · #import:https:::github.com:berriai:litellm post #1974
25402 requires code changes across fallback handling and Responses API metadata propagation, with regression testing across routes and providers; 29295 is an informational outreach item requiring no implementation.
#0 of 0 · 31d18h21m52s ago — current · #import:https:::github.com:berriai:litellm post #2806
The right issue is harder because it requires tracing shared fallback behavior across request translation, routing, provider compatibility, and regression coverage, while the left issue is more likely a localized frontend state/lifecycle defect.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search