Skip to content

Conversation

@yeonjaee
Copy link

Fixes #3920

Problem

When using the Gemini 3 Pro model (e.g., gemini-3-pro-preview) which enables thinking by default, the API returns response parts containing a thoughtSignature property. The current fromGeminiPart implementation in both googleai and vertexai plugins throws an Unsupported GeminiPart type error because it does not recognize parts that contain thoughtSignature without the thought property.

Solution

This PR updates the fromGeminiPart logic in both plugins to correctly identify and handle thoughtSignature parts by checking for both 'thought' in part and 'thoughtSignature' in part. This allows these parts to be processed by the existing fromThought / fromGeminiThought functions, which already support the thoughtSignature property.

Checklist:

  • PR title is following https://www.conventionalcommits.org/en/v1.0.0/
  • Tested (Manually verified with gemini-3-pro-preview - error resolved, responses with thoughtSignature now parse correctly)
  • Docs updated (N/A - internal fix, no API changes)

@MichaelDoyle
Copy link
Member

Thanks! I’m not totally surprised, but this does seem a little bit curious. Do you have a trace where this happened?

@yeonjaee
Copy link
Author

yeonjaee commented Dec 22, 2025

Thanks! I’m not totally surprised, but this does seem a little bit curious. Do you have a trace where this happened?

Thanks for looking into this!

The legacy plugins (@genkit-ai/googleai, @genkit-ai/vertexai) currently have a known issue with the global endpoint (see #3651), so I had to patch things locally to build and test.

The issue manifests specifically in the generate trace path, and i think providing an exact trace isn’t appropriate here since reproducing it requires additional code changes to address that separate global-endpoint issue.


I understand and agree with the project’s direction toward @genkit-ai/google-genai as the intended replacement, and I appreciate the clarification from the maintainer.

That said, while the legacy plugins are labeled as such, they are still being released and actively used. In that context, I think closing issues solely by pointing to the replacement, rather than adding guardrails or safer failure modes for existing users of the legacy plugins, can be rough from a developer experience standpoint.

Since the maintainer has closed the issue #3920 and confirmed that @genkit-ai/google-genai fully resolves this, I’m fine with this PR being closed as well — whether by me or by the maintainers — and I’ll go ahead and close it on my side. That said, if there’s still interest in adding guardrails for legacy plugin users in the future, I’d be happy to revisit this.

@yeonjaee yeonjaee changed the title fix(googleai,vertexai): support thoughtSignature in fromGeminiPart fix(js/plugins/googleai,vertexai): support thoughtSignature in fromGeminiPart Dec 22, 2025
@MichaelDoyle
Copy link
Member

@yeonjaee sorry for the rough experience. Is there something that would prevent you from switching over to the new plugin? Or more of an issue in communication?

I'm on the Firebase/Google team as well. I'll relay this to the others.

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

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[JS] Unsupported GeminiPart type error with Gemini 3 Pro

2 participants