Skip to content

Conversation

@Tarquinen
Copy link
Collaborator

@Tarquinen Tarquinen commented Jan 15, 2026

Summary

  • Detect Gemini models and inject as text parts instead of tool parts
  • Avoids thought signature validation errors with Gemini 3+ models

Problem

Gemini 3+ models have strict validation requiring thoughtSignature on functionCall parts. When the plugin injects synthetic assistant messages with tool parts, providers without robust signature handling fail with 400 errors:

Function call is missing a thought_signature in functionCall parts.

Solution

Check if the model is Gemini (via modelID.includes("gemini")) and inject the prunable tools list as a text part instead of a tool part. This avoids the thought signature requirement entirely while maintaining the same functionality.

Model Injection Type
Gemini Text part
All others Tool part (unchanged)

…errors

Gemini 3+ models have strict validation requiring thoughtSignature on functionCall parts. When the plugin injects synthetic assistant messages with tool parts, providers without robust signature handling will fail with 400 errors.

This change detects Gemini models and injects as text parts instead of tool parts, avoiding the thought signature requirement entirely.
@Tarquinen Tarquinen merged commit bea6a42 into dev Jan 15, 2026
1 check passed
@Tarquinen Tarquinen deleted the fix/gemini-thought-signature-injection branch January 15, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants