You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kimi-K2 via OpenRouter fails with tool call tokens inside thinking block #8851
When using Kimi-K2 via OpenRouter with a recent OpenCode (1.1.21), I see tool call tokens in thinking sections, and the tool stops before I get a useful response.
Looking at this in a bit more detail, it looks like there is an open bug with the Kimi-K2 model itself: MoonshotAI/Kimi-K2#89 and vLLM implements a workaround for it: vllm-project/vllm#28543
This also seems similar to this issue with GLM 4.7: #6708, although there it seems more sporadic whereas with Kimi-K2 it happens a lot.
Activity
github-actions commentedon Jan 16, 2026
This issue might be a duplicate of existing issues. Please check:
thinkingorredacted_thinkingbut foundtool_use#8010: Expectedthinkingorredacted_thinkingbut foundtool_use- Similar issue with Claude models where tool calls appear outside thinking blocksFeel free to ignore if none of these address your specific case.
juanfadev commentedon Jan 17, 2026
Same with KimiK2 Thinking in nvidia provider:
Thinking: <|tool_calls_section_begin|> <|tool_call_begin|> functions.bash:1 <|tool_call_argument_begin|> {"command": "ls -la /home/user/repo", "description": "List directory"} <|tool_call_end|> <|tool_calls_section_end|>
graham33 commentedon Jan 18, 2026
Looking at this in a bit more detail, it looks like there is an open bug with the Kimi-K2 model itself: MoonshotAI/Kimi-K2#89 and vLLM implements a workaround for it: vllm-project/vllm#28543
This also seems similar to this issue with GLM 4.7: #6708, although there it seems more sporadic whereas with Kimi-K2 it happens a lot.
qingchunnh commentedon Jan 28, 2026
I solved this issue following #6040. Hope this helps.
pascalandy commentedon Jan 28, 2026
All other models from OpenRouter are stable on my setup.
v1.1.39
wwnbb commentedon Feb 12, 2026
can you describe how you manage to fix the problem?
github-actions commentedon Apr 14, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.