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

#34522 [Bug]: Kimi K2 tool calls silently stop working on v1.91.3+ due to tool_use id normalization

  • State: open
  • Author: @benjamin20000
  • Labels: llm translation, claude code

## What happened

Running Claude Code against a proxy where the model is Kimi K2 served via vLLM (configured through litellm as an `openai`/`moonshot` custom provider, reached through the `/v1/messages` Anthropic-compatible passthrough), tool calls stop working partway through a multi-turn agentic session. Claude Code silently ends its turn mid-task instead of continuing to use tools, with no error surfaced anywhere in the client. vLLM's logs show a tool-call conversion warning around the same time, but the request otherwise completes normally (200, `finish_reason: stop`).

This reproduces on `v1.91.3` and is not present on `v1.83.10`, so it was introduced somewhere in that range.

## Root cause

Kimi K2 generates tool call ids in the fixed format `functions.{tool_name}:{index}` (e.g. `functions.Bash:0`). vLLM's and SGLang's `kimi_k2` tool parsers, and Kimi's own chat template, depend on this exact format: they derive the next tool-call index by parsing it back out of replayed conversation history (see the [vLLM blog post on debugging Kimi K2 tool-calling accuracy](https://vllm.ai/blog/2025-10-28-kimi-k2-accuracy) and [sglang#10600](https://github.com/sgl-project/sglang/issues/1060…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h21m29s ago — entered · #import:https:::github.com:berriai:litellm post #2506
34522 requires cross-provider protocol compatibility analysis, regression tracing, and careful end-to-end tool-call validation; 33329 is a localized routing-selection correction with comparatively narrow tests.
#0 of 0 · 31d17h45m44s ago — current · #import:https:::github.com:berriai:litellm post #3126
34733 requires distributed concurrency-safe accounting, atomic state transitions, asynchronous persistence guarantees, and multi-worker regression coverage; 34522 is a narrower provider-specific translation and identifier-preservation fix.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search