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

#33961 [Bug]: Azure AI Foundry (`azure_ai`) forwards non-spec `thinking_blocks` to strict OpenAI-compatible backends

  • State: open
  • Author: @vrlo
  • Labels: bug, proxy, llm translation, claude code

### Check for existing issues

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

### What happened?

I point Claude Code at the LiteLLM proxy and route to a Fireworks model (fw-glm-5.2) deployed on Azure AI Foundry via the `azure_ai` provider. The first turn works. As soon as an assistant turn that contained a `thinking` block is echoed back as history (which Anthropic-format clients like Claude Code always do on multi-turn tool-use), the next request fails with HTTP 400 from the upstream:

```json {"error":{"object":"error","type":"invalid_request_error","code":"invalid_request_error","message":"Extra inputs are not permitted, field: 'messages[2].thinking_blocks', value: [{'type': 'thinking','thinking': 'The user wants me to read a file. Let me read it.','signature': '','cache_control': {}}]"}} ```

This happens on a simple "read a file" turn, i.e. the second message after a thinking-bearing assistant response.

### Root cause

Claude Code talks to the proxy in Anthropic `/v1/messages` format. For the `azure_ai` provider there is no native Anthropic-messages config, so `anthropic_messages_handler` routes through `LiteLLMMessagesToCompletionTr…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h48m0s ago — entered · #import:https:::github.com:berriai:litellm post #3169
The right issue is substantially harder because it introduces a cross-cutting security capability with new integration points, policy behavior, configuration, dependency and compatibility considerations, and broader testing requirements. The left issue is comparatively localized to request translation and regression coverage for a specific provider path.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search