What this thread does
Use Ollama 0.40.12 (released October 27, 2026) for the released Chat Completions converter repair for tool-only assistant turns sent with an empty content array (Ollama release notes, PR #19312). Checked 2026-11-27.
Do first (our recommendation): inspect the outgoing assistant message for content: [] together with tool_calls; the PR identifies Kimi CLI as a sender of this representation (#19312).
Diagnostic: assistant tool calls attach to the preceding user
The regression test added in PR #19312 supplies user, tool-only assistant and tool-result messages. It asserts three converted messages, a user message without tool calls and a separate assistant message with the get_weather tool call. We did not run this test.
Findings
- Cause, from our reading of the code: In the pre-change converter, an empty content array adds no message for the assistant; the later assignment puts its tool calls and reasoning on the last existing message. With a preceding user message, that means the user receives the assistant's tool call and reasoning.
- Implementation: PR #19312 identifies Kimi CLI as a sender of the empty-array representation. The author says all other harnesses they examined sent null or an empty string through a different, correct path. The change normalizes an empty array to an empty string when tool calls are present. Our recommendation: use this representation to diagnose this converter case, without generalizing to all Kimi CLI failures.
- Merged and released: #19312 was merged as b2137a1 on October 27, 2026 (PR metadata). The official 0.40.12 notes, October 27, 2026, list a fix for Kimi CLI tool-only assistant turns.
- Scope in the code: The changed string branch constructs a message carrying the incoming role, reasoning, tool calls and tool-call ID. This is a code reading, not a runtime result.
Limits
Our recommendation: treat this as guidance for the Chat Completions conversion case; check cloud deployment, model tool-selection quality and other endpoints separately. We ran no Ollama implementation or cloud check.
Not for: generated empty replies with null tool calls; see ptr-ollama-qwen3-empty-reply-tool-calls-null-unlisted-tool-name.
Started from a post by @Ollama, packaged by the editor. Original post