[GH-ISSUE #15109] Gemini 3 tool continuation via /api/chat and /v1/chat/completions is missing thought_signature #9679

Closed
opened 2026-04-12 22:33:52 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @thrytku on GitHub (Mar 27, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15109

What is the issue?

gemini-3-flash-preview:cloud can emit tool calls, but multi-turn tool continuation fails because the follow-up request needs a Gemini thought_signature that Ollama does not expose through its public chat APIs.

This makes agent loops fail on the second step:

  1. model emits a tool call
  2. client executes the tool
  3. client sends tool result back with prior assistant turn
  4. Gemini rejects the continuation because the prior function call parts are missing thought_signature

Ollama version

ollama --version
# ollama version is 0.15.6

Reproduction

First request to /api/chat:

curl -sS http://127.0.0.1:11434/api/chat \
  -H 'Content-Type: application/json' \
  -d '{
    "model":"gemini-3-flash-preview:cloud",
    "stream":false,
    "think":true,
    "messages":[
      {"role":"user","content":"Call the session_status tool with an empty JSON object, then stop."}
    ],
    "tools":[
      {
        "type":"function",
        "function":{
          "name":"session_status",
          "description":"Show the current session state",
          "parameters":{"type":"object","properties":{},"additionalProperties":false}
        }
      }
    ]
  }'

Response:

{
  "message": {
    "role": "assistant",
    "content": "",
    "tool_calls": [
      {
        "id": "chj80b12",
        "function": {
          "index": 0,
          "name": "session_status",
          "arguments": {}
        }
      }
    ]
  },
  "done": true
}

No thought_signature is present in:

  • message
  • tool_calls[*]
  • tool_calls[*].function

Streaming /api/chat also does not expose it.

/v1/chat/completions has the same problem:

curl -sS http://127.0.0.1:11434/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model":"gemini-3-flash-preview:cloud",
    "messages":[
      {"role":"user","content":"Call the session_status tool with an empty JSON object, then stop."}
    ],
    "tools":[
      {
        "type":"function",
        "function":{
          "name":"session_status",
          "description":"Show the current session state",
          "parameters":{"type":"object","properties":{},"additionalProperties":false}
        }
      }
    ]
  }'

Response contains normal tool_calls, but still no Gemini signature metadata.

Failure on continuation

When the tool result is sent back in the next turn, Gemini returns:

Function call is missing a thought_signature in functionCall parts.

Why this looks like an Ollama API gap

Current public message types do not seem to have any field for Gemini tool-call signatures.

Relevant source:

  • api/types.go: Message includes thinking, tool_calls, tool_name, tool_call_id, but no thought_signature
  • docs/capabilities/tool-calling.mdx: multi-turn examples say to replay thinking + content + tool_calls
  • x/cmd/run.go: agent loop persists assistant turns with Content, Thinking, and ToolCalls, but no signature field

I also searched the current source tree and could not find:

  • thought_signature
  • thinkingSignature

Expected behavior

For Gemini models that require tool-call continuation signatures, Ollama should expose the necessary signature metadata through:

  • /api/chat
  • /v1/chat/completions

so clients can replay the assistant tool-call turn correctly on the next request.

Actual behavior

Ollama emits the initial tool call, but does not expose the signature needed for the next turn, so multi-turn tool calling breaks for Gemini.

Originally created by @thrytku on GitHub (Mar 27, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15109 ### What is the issue? `gemini-3-flash-preview:cloud` can emit tool calls, but multi-turn tool continuation fails because the follow-up request needs a Gemini `thought_signature` that Ollama does not expose through its public chat APIs. This makes agent loops fail on the second step: 1. model emits a tool call 2. client executes the tool 3. client sends tool result back with prior assistant turn 4. Gemini rejects the continuation because the prior function call parts are missing `thought_signature` ### Ollama version ```bash ollama --version # ollama version is 0.15.6 ``` ### Reproduction First request to `/api/chat`: ```bash curl -sS http://127.0.0.1:11434/api/chat \ -H 'Content-Type: application/json' \ -d '{ "model":"gemini-3-flash-preview:cloud", "stream":false, "think":true, "messages":[ {"role":"user","content":"Call the session_status tool with an empty JSON object, then stop."} ], "tools":[ { "type":"function", "function":{ "name":"session_status", "description":"Show the current session state", "parameters":{"type":"object","properties":{},"additionalProperties":false} } } ] }' ``` Response: ```json { "message": { "role": "assistant", "content": "", "tool_calls": [ { "id": "chj80b12", "function": { "index": 0, "name": "session_status", "arguments": {} } } ] }, "done": true } ``` No `thought_signature` is present in: - `message` - `tool_calls[*]` - `tool_calls[*].function` Streaming `/api/chat` also does not expose it. `/v1/chat/completions` has the same problem: ```bash curl -sS http://127.0.0.1:11434/v1/chat/completions \ -H 'Content-Type: application/json' \ -d '{ "model":"gemini-3-flash-preview:cloud", "messages":[ {"role":"user","content":"Call the session_status tool with an empty JSON object, then stop."} ], "tools":[ { "type":"function", "function":{ "name":"session_status", "description":"Show the current session state", "parameters":{"type":"object","properties":{},"additionalProperties":false} } } ] }' ``` Response contains normal `tool_calls`, but still no Gemini signature metadata. ### Failure on continuation When the tool result is sent back in the next turn, Gemini returns: ```text Function call is missing a thought_signature in functionCall parts. ``` ### Why this looks like an Ollama API gap Current public message types do not seem to have any field for Gemini tool-call signatures. Relevant source: - `api/types.go`: `Message` includes `thinking`, `tool_calls`, `tool_name`, `tool_call_id`, but no `thought_signature` - `docs/capabilities/tool-calling.mdx`: multi-turn examples say to replay `thinking + content + tool_calls` - `x/cmd/run.go`: agent loop persists assistant turns with `Content`, `Thinking`, and `ToolCalls`, but no signature field I also searched the current source tree and could not find: - `thought_signature` - `thinkingSignature` ### Expected behavior For Gemini models that require tool-call continuation signatures, Ollama should expose the necessary signature metadata through: - `/api/chat` - `/v1/chat/completions` so clients can replay the assistant tool-call turn correctly on the next request. ### Actual behavior Ollama emits the initial tool call, but does not expose the signature needed for the next turn, so multi-turn tool calling breaks for Gemini.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9679