Skip to content

Gemini 3 tool calling broken: thought_signature stripped from OpenAI-format responses #67

@shaul-saitowitz-pango

Description

@shaul-saitowitz-pango

Description

Gemini 3 models (Flash and Pro) fail on multi-turn tool calling through OpenRouter. The root cause is that OpenRouter's OpenAI-compatible format translation strips thought_signature and reasoning_details from Gemini responses. When the client sends tool results back, Gemini rejects the request with MALFORMED_FUNCTION_CALL because the required thought_signature is missing.

This affects every framework using the OpenAI-compatible API with Gemini 3 via OpenRouter (CrewAI, LangChain, Cline, Cursor, Roo-Code, LobeHub, etc.).

How It Fails

  1. Client sends request with tool definitions to google/gemini-3-flash-preview via OpenRouter
  2. Gemini responds with a function call + thought_signature in its native format
  3. OpenRouter translates to OpenAI format, dropping thought_signature
  4. Client sends tool result back (without signature, since it was never received)
  5. Gemini rejects with MALFORMED_FUNCTION_CALL — response is:
{
  "choices": [{
    "finish_reason": "error",
    "native_finish_reason": "MALFORMED_FUNCTION_CALL",
    "message": {"role": "assistant", "content": null}
  }]
}

Affected Models

  • google/gemini-3-flash-preview
  • google/gemini-3.1-pro-preview
  • Any Gemini 3+ model that requires thought_signature for tool calling

Expected Behavior

OpenRouter should preserve thought_signature / reasoning_details in the OpenAI-compatible response format (e.g., via a provider_specific_fields or similar mechanism) so clients can echo them back in subsequent requests.

Impact

This is widely reported across the ecosystem:

Gemini 3 tool calling is effectively unusable through OpenRouter's OpenAI-compatible API for any multi-turn agentic workflow.

Workaround

The only current workaround is to use Gemini's native API directly (bypassing OpenRouter), which preserves thought_signature natively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions