8 views
-/https://github.com/berriai/litellm/issues/32140
GitHub · issue

#32140 [Bug]: Router fallback between vertex_ai and gemini replays endpoint-bound thought signatures -> 400 "Corrupted thought signature" (Gemini 3.x)

  • State: open
  • Author: @alisadeghian
  • Labels: llm translation, SDK

### Check for existing issues

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

Closest matches, neither of which covers this: - #24571 reported the same symptom (Proxy, v1.81.9) but was auto-closed as stale/NOT_PLANNED on 2026-07-01 without a fix. This report adds the root cause, both replay channels, and a proposed fix location. - #18160 / PR #18374 fixed signature leakage, but only toward **non-Gemini** targets. The Gemini→Gemini cross-endpoint case is still broken.

### What happened?

We run a LiteLLM `Router` where the primary is a Vertex AI Gemini deployment and the first fallback is the **same model** on Google AI Studio, e.g.:

- primary: `vertex_ai/gemini-3.5-flash` - fallback: `gemini/gemini-3.5-flash`

In multi-turn tool-calling conversations (thinking enabled), whenever the Vertex primary fails mid-conversation (e.g. 429) and the Router falls back to the AI Studio twin, AI Studio rejects the request:

> `GeminiException BadRequestError - code 400, "Corrupted thought signature.", INVALID_ARGUMENT`

Root cause: Gemini thought signatures are **endpoint-bound** — a signature minted by Vertex AI does not validate on `generativelanguag…

GitHub resolver

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

Refresh page
vote history (4 events)
#0 of 0 · 31d18h35m15s ago — entered · #import:https:::github.com:berriai:litellm post #2466
The left issue requires cross-provider request-state handling across routing, retries, translation, and regression coverage, with higher compatibility risk. The right issue is a localized UI/link-generation change with comparatively small scope.
Cross-provider request translation and retry semantics require coordinated changes across provider adapters, conversation state, and fallback paths, with substantial compatibility and regression risk. The other task is narrower: correcting shared-state synchronization and initialization in budget enforcement.
The left requires a cross-cutting API/design change spanning routing state, error normalization, provider behavior, and compatibility guarantees, while the right is a focused request-rewriting fix with narrower validation scope.
#0 of 0 · 31d17h29m29s ago — current · #import:https:::github.com:berriai:litellm post #3565
Supporting multiple new provider integrations across SDK, proxy, model mapping, parameter translation, cost tracking, and compatibility testing has substantially broader scope and higher integration risk than a focused routing/signature-handling bug fix.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search