Skip to content

fix(google): handle thoughtSignature differently for Gemini 2.5 vs 3#6890

Merged
alexhancock merged 1 commit intoblock:mainfrom
rabi:streaming_again
Feb 2, 2026
Merged

fix(google): handle thoughtSignature differently for Gemini 2.5 vs 3#6890
alexhancock merged 1 commit intoblock:mainfrom
rabi:streaming_again

Conversation

@rabi
Copy link
Contributor

@rabi rabi commented Feb 2, 2026

Summary

Fixes a regression introduced in e4938c6 where Gemini 2.5 Pro's first streaming chunk got hidden, as it changed streaming to treat all signed text as Thinking content to fix Gemini 3's intermittent 400 errors. However, Gemini 2.5 behaves differently with thoughtSignature:

  • Gemini 3: Uses thoughtSignature for actual thinking/reasoning content. Requires the signature to be preserved and sent back to avoid intermittent 400 errors ("content block missing a thought_signature").

  • Gemini 2.5: Includes thoughtSignature on the first chunk as metadata, not actual thinking. This is regular text.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

Tested locally with 3.0/2.5 models.

…mini 3

Fixes a regression introduced in e4938c6 where Gemini 2.5 Pro's first
streaming chunk got hidden, as it changed streaming to treat all signed
text as Thinking content to fix Gemini 3's intermittent 400 errors. However,
Gemini 2.5 behaves differently with thoughtSignature:

- Gemini 3: Uses thoughtSignature for actual thinking/reasoning content.
  Requires the signature to be preserved and sent back to avoid intermittent
  400 errors ("content block missing a thought_signature").

- Gemini 2.5: Includes thoughtSignature on the first chunk as metadata,
  not actual thinking. This is regular text.

Signed-off-by: rabi <ramishra@redhat.com>
@rabi rabi mentioned this pull request Feb 2, 2026
@alexhancock alexhancock merged commit e989031 into block:main Feb 2, 2026
17 checks passed
stebbins pushed a commit to stebbins/goose that referenced this pull request Feb 4, 2026
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