#25322 [Bug]: Gemini models degenerate in multi-turn tool-calling via /v1/messages โ thoughtSignature not propagated from thought parts
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
When using Gemini models through LiteLLM's `/v1/messages` endpoint for multi-turn tool-calling conversations (e.g. Claude Code), the model degenerates after several turns โ producing garbage short responses ("ja"), repetition loops ("Executing. Done. Going. Now."), or stopping mid-task. This happens because Gemini's `thoughtSignature` is not properly round-tripped between turns.
There are two related failures:
---
### Failure 1: thoughtSignature on thought parts is never captured
Gemini's API requires that the `thoughtSignature` from the previous assistant turn be echoed back on the next turn for multi-turn thinking coherence. LiteLLM's `_transform_parts()` in `vertex_and_google_ai_studio_gemini.py` only reads `thoughtSignature` from the part that contains `functionCall`:
```python # Current code in _transform_parts: if "functionCall" in part: _function_chunk = { ... } thought_signature = part.get("thoughtSignature") # โ only checks THIS part ```
But Gemini often places `thoughtSignature` on a **separate** thought part (`thought:โฆ