ollama - 💡(How to fix) Fix Ollama Cloud: Gemini 3 tool-calling fails (missing thought_signature) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14784Fetched 2026-04-08 00:31:42
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1cross-referenced ×1subscribed ×1

Error Message

Error: This error is specific to Gemini 3's safety mechanism which requires a thought_signature to be preserved across tool-calling turns. It appears the Ollama native API (/api/chat) currently doesn't expose or persist this signature when proxying Gemini 3 models, making tool-calling impossible for Gemini 3 on the cloud platform.

RAW_BUFFERClick to expand / collapse

Description: Gemini 3 models served via Ollama Cloud (ollama.com) fail during tool-calling loops. The first tool-call is generated correctly, but when sending the tool result back to continue the conversation, the API returns a 400 Bad Request.

Error: "Function call is missing a thought_signature in functionCall parts."

Context: This error is specific to Gemini 3's safety mechanism which requires a thought_signature to be preserved across tool-calling turns. It appears the Ollama native API (/api/chat) currently doesn't expose or persist this signature when proxying Gemini 3 models, making tool-calling impossible for Gemini 3 on the cloud platform.

Tested with:

  • Endpoint: https://ollama.com
  • API: Native Ollama (non-streaming)
  • Model: gemini-3-flash-preview:cloud (and others)
  • Client: OpenClaw

Expected behavior: The thought_signature should be persisted server-side by Ollama Cloud or exposed in the API response so it can be returned in the subsequent turn.

extent analysis

Fix Plan

To resolve the issue, we need to modify the Ollama Cloud API to persist or expose the thought_signature for Gemini 3 models.

Steps to Fix

  • Modify the API endpoint /api/chat to include the thought_signature in the response.
  • Update the client-side code to store and return the thought_signature in subsequent requests.

Example Code

# Server-side (Ollama Cloud API)
from flask import jsonify

@app.route('/api/chat', methods=['POST'])
def chat():
    # ... existing code ...
    response = {
        'tool_call': tool_call,
        'thought_signature': thought_signature  # Add this line
    }
    return jsonify(response)

# Client-side (OpenClaw)
import requests

def send_tool_call(tool_call, thought_signature):
    response = requests.post('https://ollama.com/api/chat', json={
        'tool_call': tool_call,
        'thought_signature': thought_signature  # Add this line
    })
    return response.json()

Verification

To verify the fix, test the API endpoint with a Gemini 3 model and check that the thought_signature is included in the response. Then, send a subsequent request with the stored thought_signature and verify that the API returns a successful response (200 OK).

Extra Tips

  • Ensure that the thought_signature is properly validated and sanitized to prevent security vulnerabilities.
  • Consider implementing a caching mechanism to store the thought_signature for each conversation, in case the client-side storage fails.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING