Disclaimer: this was found and patched locally by codex while i was working on a personal project. Apologies if this is off base.
When using DurableAgent with Gemini thinking models and tools, follow‑up steps fail with:
“Function call is missing a thought_signature in functionCall parts…”
This happens because the workflow reconstructs tool‑call history without providerOptions, so the Gemini adapter can’t read thoughtSignature.
Environment
- @workflow/ai: 4.0.1-beta.40
- ai: 6.0.5
- @ai-sdk/google: 3.0.2
- Model: gemini-3-flash-preview (thinking enabled)
Repro
- Use DurableAgent with Gemini model + tools.
- A tool call is generated and executed.
- Next step errors:
“Function call is missing a thought_signature in functionCall parts…”
Root cause
In packages/ai/src/agent/stream-text-iterator.ts, when finishReason === 'tool-calls', the tool call is appended without providerOptions:
conversationPrompt.push({
role: 'assistant',
content: toolCalls.map((toolCall) => ({
type: 'tool-call',
toolCallId: toolCall.toolCallId,
toolName: toolCall.toolName,
input: JSON.parse(toolCall.input),
// providerOptions missing
})),
});
The Gemini adapter reads thoughtSignature from part.providerOptions.google.thoughtSignature, not providerMetadata, so the next request fails.
Proposed fix
Pass provider metadata through providerOptions when reconstructing tool‑calls:
...(toolCall.providerMetadata
? { providerOptions: toolCall.providerMetadata }
: {}),
Additional context
We patched node_modules/@workflow/ai/dist/agent/stream-text-iterator.js locally and the error disappears.
Disclaimer: this was found and patched locally by codex while i was working on a personal project. Apologies if this is off base.
When using DurableAgent with Gemini thinking models and tools, follow‑up steps fail with:
“Function call is missing a thought_signature in functionCall parts…”
This happens because the workflow reconstructs tool‑call history without providerOptions, so the Gemini adapter can’t read thoughtSignature.
Environment
Repro
“Function call is missing a thought_signature in functionCall parts…”
Root cause
In
packages/ai/src/agent/stream-text-iterator.ts, when finishReason === 'tool-calls', the tool call is appended without providerOptions:The Gemini adapter reads thoughtSignature from part.providerOptions.google.thoughtSignature, not providerMetadata, so the next request fails.
Proposed fix
Pass provider metadata through providerOptions when reconstructing tool‑calls:
Additional context
We patched node_modules/@workflow/ai/dist/agent/stream-text-iterator.js locally and the error disappears.