From 39145bd9b58d2539fd342a56568e05b067e2ba7d Mon Sep 17 00:00:00 2001 From: Andrew Trokhymenko Date: Mon, 9 Nov 2026 23:06:41 -0500 Subject: [PATCH] fix(google): promote stripped proxy call thoughtSignature onto surviving sibling functionCall (#6079, #5252) --- src/loop/adapter-google.ts | 67 ++++-- src/loop/core.ts | 7 +- src/stream-google.ts | 24 +- tests/adapter-google.test.ts | 422 ++++++++++++++++++++++++++++++++++- 4 files changed, 503 insertions(+), 17 deletions(-) diff --git a/src/loop/adapter-google.ts b/src/loop/adapter-google.ts index 21b77f82b9..bb45909cf9 100644 --- a/src/loop/adapter-google.ts +++ b/src/loop/adapter-google.ts @@ -20,6 +20,7 @@ const PROXY_TOOL_SET = new Set([ // here or their chunks raw-replay to the client as "real" calls. acp_cache // had the same gap before this change. "acp_retire", "acp_restore", "acp_rewrite", "acp_cache", + "acp_retrieve", "acp_rule", "acp_read_original_image", "bili_compress", "bili_decompress", "bili_search_context", "bili_status", ]); @@ -101,35 +102,53 @@ interface FunctionCallBuffer { } // A decision per buffered chunk that carried functionCall parts: "keep" = every -// call in it is real (replay verbatim, preserving signatures/ids/order), null = -// only proxy calls (drop — the proxy executes them server-side), or a rewritten -// copy keeping the chunk's other parts plus its real calls. +// call in it is real and needs no signature promotion (replay verbatim, +// preserving signatures/ids/order), null = only proxy calls (drop — the proxy +// executes them server-side), or a rewritten copy keeping the chunk's other +// parts plus its real calls (promoting a stripped proxy call's thoughtSignature +// onto the first surviving real functionCall part when Gemini placed the turn +// signature on the leading proxy call). function filterRealCallChunk( parsed: Record, realIndexes: Set, callIndexes: number[], + promoteSig?: { callIndex: number; signature: string }, ): "keep" | null | Record { const candidates = parsed.candidates as Array> | undefined; const parts = (candidates?.[0]?.content as { parts?: GooglePart[] } | undefined)?.parts; if (!Array.isArray(parts)) return "keep"; let anyReal = false; let anyProxy = false; - const keep: boolean[] = []; + let sigPromoted = false; + const outParts: GooglePart[] = []; let call = 0; for (const part of parts) { if (part && typeof part === "object" && part.functionCall) { - const real = realIndexes.has(callIndexes[call] ?? -1); + const callIdx = callIndexes[call] ?? -1; + const real = realIndexes.has(callIdx); call += 1; - keep.push(real); - if (real) anyReal = true; - else anyProxy = true; + if (real) { + anyReal = true; + if ( + promoteSig && + callIdx === promoteSig.callIndex && + (typeof part.thoughtSignature !== "string" || part.thoughtSignature.length === 0) + ) { + outParts.push({ ...part, thoughtSignature: promoteSig.signature }); + sigPromoted = true; + } else { + outParts.push(part); + } + } else { + anyProxy = true; + } } else { - keep.push(true); + outParts.push(part); } } - if (!anyProxy) return "keep"; + if (!anyProxy && !sigPromoted) return "keep"; if (!anyReal) return null; - return cloneChunk(parsed, { parts: parts.filter((_, i) => keep[i]) }); + return cloneChunk(parsed, { parts: outParts }); } function dataLine(frame: string): string | null { @@ -440,21 +459,43 @@ export function createGoogleAdapter( } return; } + // Gemini attaches thoughtSignature only to the FIRST functionCall + // part in a parallel-call turn. When a stripped proxy call (e.g. + // compress) led the turn and carried that signature, the first + // surviving real functionCall part becomes the turn's leading call + // on client replay and must inherit the signature or Gemini 3/4 + // rejects the next turn with 400 INVALID_ARGUMENT (missing + // thought_signature). + let firstRealIdx: number | undefined; + let firstProxySig = ""; + for (const [idx, tc] of pending) { + if (realIndexes.has(idx)) { + if (firstRealIdx === undefined && tc.name.length > 0) firstRealIdx = idx; + } else if (firstProxySig.length === 0 && tc.signature.length > 0) { + firstProxySig = tc.signature; + } + } + const firstRealTc = firstRealIdx !== undefined ? pending.get(firstRealIdx) : undefined; + const promoteSig = + firstRealIdx !== undefined && firstRealTc && firstRealTc.signature.length === 0 && firstProxySig.length > 0 + ? { callIndex: firstRealIdx, signature: firstProxySig } + : undefined; for (const [idx, tc] of pending) { if (realIndexes.has(idx) && tc.name.length > 0) { toolCallsEmitted++; + const sig = tc.signature || (promoteSig?.callIndex === idx ? promoteSig.signature : ""); yield { kind: "tool_call", name: tc.name, callId: tc.id, arguments: tc.args, passthrough: true, - ...(tc.signature ? { signature: tc.signature } : {}), + ...(sig ? { signature: sig } : {}), } as ParsedStreamEvent; } } for (const { json, parsed, callIndexes } of rawCallChunks) { - const filtered = filterRealCallChunk(parsed, realIndexes, callIndexes); + const filtered = filterRealCallChunk(parsed, realIndexes, callIndexes, promoteSig); if (filtered === "keep") { yield { kind: "meta", chunk: Buffer.from(`data: ${json}\n\n`, "utf8") } as ParsedStreamEvent; } else if (filtered !== null) { diff --git a/src/loop/core.ts b/src/loop/core.ts index dc21c65327..fce3741f0d 100644 --- a/src/loop/core.ts +++ b/src/loop/core.ts @@ -1529,8 +1529,13 @@ export async function* runCompressLoop( coreMessages.push(redactedMsg); } } + const roundProxySignature = + ctx.protocol === "google" + ? proxyResults.find((p) => typeof p.signature === "string" && p.signature.length > 0)?.signature + : undefined; for (const pr of proxyResults) { if (functionCallIds.has(pr.callId)) { + const sig = pr.signature || roundProxySignature; coreMessages.push({ id: `acp_loop_r${round}_asst_tc_${pr.callId}`, role: "assistant", @@ -1539,7 +1544,7 @@ export async function* runCompressLoop( toolCallId: pr.callId, // #3661: guaranteed-valid-JSON replay (see wireArguments); raw model bytes stay in pr.arguments for #156 signatures. text: pr.wireArguments, - ...(ctx.protocol === "google" && pr.signature ? { googleThoughtSignature: pr.signature } : {}), + ...(ctx.protocol === "google" && sig ? { googleThoughtSignature: sig } : {}), }); const toolResultMsg: CoreMessage = { id: `acp_loop_r${round}_tool_${pr.callId}`, diff --git a/src/stream-google.ts b/src/stream-google.ts index 54dc5dc18a..7835f9207b 100644 --- a/src/stream-google.ts +++ b/src/stream-google.ts @@ -22,6 +22,7 @@ function* rewriteGoogleJsonSteps(body: unknown, ctx: RewriteCtx): Generator 0) { + promotedSignature = part.thoughtSignature; + } const args = fc.args !== null && typeof fc.args === "object" ? (fc.args as Record) : {}; noteParts.push(yield { name: fc.name, args, id: typeof fc.id === "string" ? fc.id : undefined }); continue; @@ -53,10 +57,28 @@ function* rewriteGoogleJsonSteps(body: unknown, ctx: RewriteCtx): Generator 0) { + const firstFcIdx = keptParts.findIndex((p) => p && typeof p === "object" && p.functionCall !== undefined); + if (firstFcIdx >= 0) { + const firstFc = keptParts[firstFcIdx]!; + if (typeof firstFc.thoughtSignature !== "string" || firstFc.thoughtSignature.length === 0) { + keptParts[firstFcIdx] = { ...firstFc, thoughtSignature: promotedSignature }; + } + } + } // The tool result is a NEW text part: an existing text part may carry a // thoughtSignature the client echoes back, and appending to its text would // leave the signature describing a string that no longer exists. - content.parts = [...keptParts, { text: noteParts.join("\n") }]; + const notePart: GooglePart = + !sawReal && + promotedSignature.length > 0 && + !keptParts.some((p) => p && typeof p === "object" && typeof p.thoughtSignature === "string" && p.thoughtSignature.length > 0) + ? { text: noteParts.join("\n"), thoughtSignature: promotedSignature } + : { text: noteParts.join("\n") }; + content.parts = [...keptParts, notePart]; if (!sawReal) { candidate.finishReason = "STOP"; } diff --git a/tests/adapter-google.test.ts b/tests/adapter-google.test.ts index ac3c7f6d3c..65a876bf85 100644 --- a/tests/adapter-google.test.ts +++ b/tests/adapter-google.test.ts @@ -1,8 +1,11 @@ import { test } from "node:test"; import assert from "node:assert/strict"; -import type { CoreMessage } from "acp-kernel"; -import { createGoogleAdapter } from "../src/loop/index.ts"; +import { createCore, defaultConfig, type CoreMessage } from "acp-kernel"; +import { coreToGoogle, googleToCore, type GooglePart } from "acp-kernel/wire"; +import { createGoogleAdapter, runCompressLoop } from "../src/loop/index.ts"; import type { CompressLoopAdapter, ParsedStreamEvent } from "../src/loop/index.ts"; +import { createSession } from "../src/session.ts"; +import { rewriteGoogleJsonResponseAsync } from "../src/stream-google.ts"; function sse(obj: unknown): string { return `data: ${JSON.stringify(obj)}\n\n`; @@ -349,3 +352,418 @@ test("google parseStream: a null sibling part does not break the edited frame", const frames = framesOf(events); assert.ok(frames.some((f) => f.includes("kept prose")), `the prose still reaches the client, got: ${frames.join(" | ")}`); }); + +test("google parseStream: parallel [compress (signed), write_file (unsigned)] in same chunk promotes thoughtSignature onto write_file", async () => { + const adapter = createGoogleAdapter(REQUEST_BODY, "client system", "bili_absorb", "gemini-4-argon-medium"); + const events = await collect( + adapter, + sse({ + candidates: [{ + content: { + role: "model", + parts: [ + { + functionCall: { + name: "compress", + args: { content: "m00046-m00129: folded context\nsummary body" }, + id: "call_compress_1", + }, + thoughtSignature: "sig-parallel-same-chunk", + }, + { + functionCall: { + name: "write_file", + args: { path: "src/app.ts", content: "export const ok = true;\n" }, + id: "call_write_2", + }, + }, + { + functionCall: { + name: "read_file", + args: { path: "README.md" }, + id: "call_read_3", + }, + }, + ], + }, + index: 0, + }], + }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }), + ); + + const toolCalls = events.filter((e): e is Extract => e.kind === "tool_call"); + const writeEvent = toolCalls.find((e) => e.name === "write_file"); + const readEvent = toolCalls.find((e) => e.name === "read_file"); + const compressEvent = toolCalls.find((e) => e.name === "compress"); + assert.ok(writeEvent && writeEvent.passthrough === true, "write_file emitted as passthrough real call"); + assert.equal(writeEvent.signature, "sig-parallel-same-chunk", "first surviving real call event inherits thoughtSignature"); + assert.ok(readEvent && readEvent.passthrough === true, "read_file emitted as passthrough real call"); + assert.equal(readEvent.signature, undefined, "subsequent sibling real call stays unsigned"); + assert.ok(compressEvent && compressEvent.passthrough !== true, "compress emitted as server-side proxy call"); + + const callMeta = events.find((e) => e.kind === "meta" && e.chunk.toString("utf8").includes("write_file")); + assert.ok(callMeta && callMeta.kind === "meta", "replayed call frame present"); + const replayedParts = partsOf(frameJson(callMeta.chunk)); + assert.equal(replayedParts.length, 2, "compress stripped; two real calls kept"); + assert.deepEqual(replayedParts[0].functionCall, { + name: "write_file", + args: { path: "src/app.ts", content: "export const ok = true;\n" }, + id: "call_write_2", + }); + assert.equal(replayedParts[0].thoughtSignature, "sig-parallel-same-chunk", "first surviving real functionCall part carries promoted thoughtSignature"); + assert.equal(replayedParts[1].thoughtSignature, undefined, "second surviving real functionCall part stays unsigned"); +}); + +test("google parseStream: parallel [compress (signed), write_file (unsigned)] across separate chunks promotes thoughtSignature onto write_file chunk", async () => { + const adapter = createGoogleAdapter(REQUEST_BODY, "client system", "bili_absorb", "gemini-4-argon-medium"); + const events = await collect( + adapter, + sse({ + candidates: [{ + content: { + role: "model", + parts: [{ + functionCall: { + name: "compress", + args: { content: "m00001-m00010: folded\nsummary" }, + id: "call_compress_chunk1", + }, + thoughtSignature: "sig-parallel-chunk1", + }], + }, + index: 0, + }], + }) + + sse({ + candidates: [{ + content: { + role: "model", + parts: [{ + functionCall: { + name: "write_file", + args: { path: "src/index.ts", content: "console.log(1);\n" }, + id: "call_write_chunk2", + }, + }], + }, + index: 0, + }], + }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }), + ); + + const allFrames = framesOf(events).join(""); + assert.equal(allFrames.includes("call_compress_chunk1"), false, "proxy-only chunk 1 is dropped from client stream"); + const callMeta = events.find((e) => e.kind === "meta" && e.chunk.toString("utf8").includes("write_file")); + assert.ok(callMeta && callMeta.kind === "meta", "chunk 2 replayed with write_file"); + const replayedParts = partsOf(frameJson(callMeta.chunk)); + assert.equal(replayedParts.length, 1); + assert.equal(replayedParts[0].thoughtSignature, "sig-parallel-chunk1", "chunk 2 real functionCall part inherits chunk 1 proxy call's thoughtSignature"); +}); + +test("google parseStream: real call with its own thoughtSignature is never overwritten by a sibling proxy call", async () => { + const adapter = createGoogleAdapter(REQUEST_BODY, "client system", "bili_absorb", "gemini-4-argon-medium"); + const events = await collect( + adapter, + sse({ + candidates: [{ + content: { + role: "model", + parts: [ + { + functionCall: { name: "write_file", args: { path: "a.ts" }, id: "call_1" }, + thoughtSignature: "sig-own-real", + }, + { + functionCall: { name: "compress", args: {}, id: "call_2" }, + thoughtSignature: "sig-proxy-other", + }, + ], + }, + index: 0, + }], + }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }), + ); + + const callMeta = events.find((e) => e.kind === "meta" && e.chunk.toString("utf8").includes("write_file")); + assert.ok(callMeta && callMeta.kind === "meta"); + const replayedParts = partsOf(frameJson(callMeta.chunk)); + assert.equal(replayedParts.length, 1); + assert.equal(replayedParts[0].thoughtSignature, "sig-own-real", "real call's own signature is preserved"); +}); + +test("rewriteGoogleJsonResponseAsync: promotes stripped proxy call thoughtSignature onto surviving real functionCall part", async () => { + const core = createCore(); + const config = defaultConfig(400_000); + const session = createSession("google-json-sig"); + const messages: CoreMessage[] = [ + { id: "m1", role: "user", contentType: "text", text: "step 1" }, + { id: "m2", role: "assistant", contentType: "text", text: "ack 1" }, + { id: "m3", role: "user", contentType: "text", text: "step 2" }, + { id: "m4", role: "assistant", contentType: "text", text: "ack 2" }, + { id: "m5", role: "user", contentType: "text", text: "step 3" }, + { id: "m6", role: "assistant", contentType: "text", text: "ack 3" }, + { id: "m7", role: "user", contentType: "text", text: "step 4" }, + ]; + const turn = core.processTurn({ messages, state: session.state, config, tokenCount: 0 }); + session.state = turn.state; + + const responseBody = { + candidates: [{ + content: { + role: "model", + parts: [ + { + functionCall: { + name: "compress", + args: { content: "m00001-m00003: early steps\ncompleted step 1 and step 2" }, + id: "fc_compress", + }, + thoughtSignature: "sig-json-parallel", + }, + { + functionCall: { + name: "write_file", + args: { path: "out.txt", content: "done" }, + id: "fc_write", + }, + }, + ], + }, + finishReason: "STOP", + }], + }; + + const rewritten = (await rewriteGoogleJsonResponseAsync(responseBody, { + core, + config, + messages, + session, + log: () => {}, + })) as { candidates: Array<{ content: { parts: GooglePart[] } }> }; + + const outParts = rewritten.candidates[0].content.parts; + const fcParts = outParts.filter((p) => p.functionCall !== undefined); + assert.equal(fcParts.length, 1, "compress stripped, write_file kept"); + assert.equal(fcParts[0].functionCall?.name, "write_file"); + assert.equal(fcParts[0].thoughtSignature, "sig-json-parallel", "write_file inherited thoughtSignature from stripped compress call"); +}); + +test("runCompressLoop + next-turn Google replay: mixed [compress, write_file] turn keeps thoughtSignature on write_file after fold", async () => { + const core = createCore(); + const config = defaultConfig(400_000); + const session = createSession("google-loop-mixed-sig"); + + const initialContents = [ + { role: "user", parts: [{ text: "task 1" }] }, + { role: "model", parts: [{ text: "done 1" }] }, + { role: "user", parts: [{ text: "task 2" }] }, + { role: "model", parts: [{ text: "done 2" }] }, + { role: "user", parts: [{ text: "task 3" }] }, + { role: "model", parts: [{ text: "done 3" }] }, + { role: "user", parts: [{ text: "now compress and write file" }] }, + ]; + const flat1 = googleToCore({ contents: initialContents }); + const turn1 = core.processTurn({ messages: flat1.msgs, state: session.state, config, tokenCount: 0 }); + session.state = turn1.state; + + const upstreamSse = + sse({ + candidates: [{ + content: { + role: "model", + parts: [ + { thought: true, text: "I will compress m00001-m00004 and call write_file." }, + { + functionCall: { + name: "compress", + args: { content: "m00001-m00004: tasks 1-2\ncompleted tasks 1 and 2" }, + id: "call_compress_mixed", + }, + thoughtSignature: "sig-gemini4-active-turn", + }, + { + functionCall: { + name: "write_file", + args: { path: "result.txt", content: "hello" }, + id: "call_write_mixed", + }, + }, + ], + }, + index: 0, + }], + }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }); + + const reqBody: Record = { contents: initialContents }; + const adapter = createGoogleAdapter(reqBody, undefined, undefined, "gemini-4-argon-medium"); + const streamedChunks: string[] = []; + for await (const chunk of runCompressLoop( + new Response(upstreamSse, { status: 200 }).body!, + { + core, + config, + messages: turn1.messages, + compressMessages: flat1.msgs, + session, + protocol: "google", + log: () => {}, + }, + reqBody, + { url: "http://127.0.0.1:1/v1beta/models/gemini-4-argon-medium:streamGenerateContent?alt=sse", headers: {} }, + adapter, + "system prompt", + )) { + streamedChunks.push(chunk.toString("utf8")); + } + + // Reconstruct the model turn parts exactly as a Google SSE client accumulates them. + const clientReceivedParts: GooglePart[] = []; + for (const raw of streamedChunks.join("").split("\n\n")) { + const line = raw.split("\n").find((l) => l.startsWith("data:")); + if (!line) continue; + const parsed = JSON.parse(line.slice(5).trim()) as { + candidates?: Array<{ content?: { parts?: GooglePart[] } }>; + }; + const ps = parsed.candidates?.[0]?.content?.parts ?? []; + clientReceivedParts.push(...ps); + } + + const writePartOnWire = clientReceivedParts.find((p) => p.functionCall?.name === "write_file"); + assert.ok(writePartOnWire, "client received write_file functionCall part"); + assert.equal(writePartOnWire.thoughtSignature, "sig-gemini4-active-turn", "streamed write_file part carries thoughtSignature"); + + // Next turn: client appends the model turn + functionResponse for write_file, and bili prepares the folded outbound body. + const nextTurnContents = [ + ...initialContents, + { role: "model", parts: clientReceivedParts }, + { + role: "user", + parts: [{ + functionResponse: { + name: "write_file", + id: "call_write_mixed", + response: { output: "ok" }, + }, + }], + }, + ]; + const flat2 = googleToCore({ contents: nextTurnContents }); + const turn2 = core.processTurn({ messages: flat2.msgs, state: session.state, config, tokenCount: 0 }); + const outboundContents = coreToGoogle(turn2.messages); + const modelTurnWithWrite = outboundContents.find( + (c) => c.role === "model" && c.parts.some((p) => p.functionCall?.name === "write_file"), + ); + assert.ok(modelTurnWithWrite, "outbound Google contents contain the write_file model turn"); + const outboundWritePart = modelTurnWithWrite.parts.find((p) => p.functionCall?.name === "write_file"); + assert.ok(outboundWritePart, "write_file part present on outbound wire"); + assert.equal( + outboundWritePart.thoughtSignature, + "sig-gemini4-active-turn", + "surviving write_file part retains thoughtSignature after fold on next turn", + ); +}); + +test("runCompressLoop Google re-request: parallel proxy-only calls [compress (signed), acp_status (unsigned)] keep thoughtSignature on every rebuilt model functionCall turn", async () => { + const core = createCore(); + const config = defaultConfig(400_000); + const session = createSession("google-loop-multi-proxy-sig"); + + const initialContents = [ + { role: "user", parts: [{ text: "step 1" }] }, + { role: "model", parts: [{ text: "done 1" }] }, + { role: "user", parts: [{ text: "step 2" }] }, + { role: "model", parts: [{ text: "done 2" }] }, + { role: "user", parts: [{ text: "compress and check status" }] }, + ]; + const flat = googleToCore({ contents: initialContents }); + const turn = core.processTurn({ messages: flat.msgs, state: session.state, config, tokenCount: 0 }); + session.state = turn.state; + + const round1Sse = + sse({ + candidates: [{ + content: { + role: "model", + parts: [ + { + functionCall: { + name: "compress", + args: { content: "m00001-m00002: step 1\ncompleted step 1" }, + id: "call_proxy_compress", + }, + thoughtSignature: "sig-multi-proxy-round1", + }, + { + functionCall: { + name: "acp_status", + args: {}, + id: "call_proxy_status", + }, + }, + ], + }, + index: 0, + }], + }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }); + + const round2Sse = + sse({ candidates: [{ content: { role: "model", parts: [{ text: "All folded and checked." }] }, index: 0 }] }) + + sse({ candidates: [{ content: { role: "model", parts: [] }, finishReason: "STOP", index: 0 }] }); + + let capturedRound2Body: { contents?: Array<{ role?: string; parts?: GooglePart[] }> } | undefined; + const origFetch = globalThis.fetch; + globalThis.fetch = (async (_input: unknown, init?: RequestInit) => { + capturedRound2Body = JSON.parse(String(init?.body ?? "{}")) as { + contents?: Array<{ role?: string; parts?: GooglePart[] }>; + }; + return new Response(round2Sse, { + status: 200, + headers: { "content-type": "text/event-stream" }, + }); + }) as typeof fetch; + + try { + const reqBody: Record = { contents: initialContents }; + const adapter = createGoogleAdapter(reqBody, undefined, undefined, "gemini-4-argon-medium"); + for await (const _ of runCompressLoop( + new Response(round1Sse, { status: 200 }).body!, + { + core, + config, + messages: turn.messages, + compressMessages: flat.msgs, + session, + protocol: "google", + log: () => {}, + }, + reqBody, + { url: "http://127.0.0.1:1/v1beta/models/gemini-4-argon-medium:streamGenerateContent?alt=sse", headers: {} }, + adapter, + "system prompt", + )) { + // drain + } + } finally { + globalThis.fetch = origFetch; + } + + assert.ok(capturedRound2Body?.contents, "round 2 re-request body captured"); + const modelFcTurns = capturedRound2Body.contents.filter( + (c) => c.role === "model" && (c.parts ?? []).some((p) => p.functionCall !== undefined), + ); + assert.ok(modelFcTurns.length >= 2, "both proxy tool calls are present in round 2 re-request"); + for (const modelTurn of modelFcTurns) { + const firstFc = (modelTurn.parts ?? []).find((p) => p.functionCall !== undefined); + assert.ok(firstFc, "model turn has functionCall part"); + assert.equal( + firstFc.thoughtSignature, + "sig-multi-proxy-round1", + `functionCall ${firstFc.functionCall?.name} carries round thoughtSignature`, + ); + } +});