fix(ai): correct Google thinking detection and remove unsupported id fields

- isThinkingPart now only checks thought === true, not thoughtSignature
- thoughtSignature is for context replay and can appear on any part type
- Store thoughtSignature on text blocks as textSignature for proper replay
- Remove id from functionCall/functionResponse (unsupported by Vertex/Cloud Code Assist)

Refs: https://ai.google.dev/gemini-api/docs/thought-signatures
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
theBucky 2026-01-12 00:27:09 +08:00 committed by Mario Zechner
parent f5e97427ce
commit 4f757fbe23
5 changed files with 33 additions and 22 deletions

View file

@ -511,6 +511,12 @@ export const streamGoogleGeminiCli: StreamFunction<"google-gemini-cli"> = (
});
} else {
currentBlock.text += part.text;
if (part.thoughtSignature) {
currentBlock.textSignature = retainThoughtSignature(
currentBlock.textSignature,
part.thoughtSignature,
);
}
stream.push({
type: "text_delta",
contentIndex: blockIndex(),