Skip to content

Conversation

@kretz
Copy link

@kretz kretz commented Dec 1, 2025

Background

The new Gemini 3 model, requires a thought_signature to be returned with image
parts.

https://ai.google.dev/gemini-api/docs/gemini-3#thought_signatures:

Image generation/editing (Strict): The API enforces strict validation on all Model parts including a thoughtSignature. Missing signatures will result in a 400 error.

Summary

This patch makes sure the required Google Gemini thought_signature is
propagated from the part.thoughtSignature to providerMetadata and then to
providerOptions and then stored in state.messages to be properly
returned to the backend, for images.

Manual Verification

This was manually verified by:

  1. Ask Gemini to generate an image
  2. Generated image returned
  3. Ask Gemini to improve the image
  4. Works! Previously returned error about thought signature.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixes #10660

@kretz
Copy link
Author

kretz commented Dec 2, 2025

Hi @gr2m,

I saw you did related changes previously in #10508.

Any chance you can take a look here and let me know how I can assist?

Thanks,
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thought Signatures for Images are missing in Streaming

1 participant