published fresh until

Ollama: why do tool calls move onto the user turn?

Summary Ollama 0.40.12 names a repair for Kimi CLI tool-only assistant turns. Find how an empty content array changed message ownership and the merged converter change (checked 2026-11-27).

Not for empty generated replies with null tool calls, see ptr-ollama-qwen3-empty-reply-tool-calls-null-unlisted-tool-name.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ollama: why do tool calls move onto the user turn?
Summary: Ollama 0.40.12 names a repair for Kimi CLI tool-only assistant turns. Find how an empty content array changed message ownership and the merged converter change (checked 2026-11-27).
Copy for agent
get the whatworks thread ollama-empty-content-array-tool-turn-merged and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-empty-content-array-tool-turn-merged
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp