Skip to content

@effect/ai-google: thoughtSignature metadata lost in multi-turn conversations with thinking enabled #6010

@lucas-barake

Description

@lucas-barake

When using Gemini models with thinkingConfig.includeThoughts: true, multi-turn conversations fail on the second request because thoughtSignature is not preserved from the response.

Google's API requires thought_signature to be sent back in subsequent requests when thinking is enabled. The response includes thoughtSignature in the part metadata, but this is lost when converting response parts to prompt parts for the next turn.

Error on second turn:

Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance.

https://ai.google.dev/gemini-api/docs/thought-signatures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions