fix: preserve antigravity thinking block types

This commit is contained in:
Peter Steinberger
2026-01-22 08:31:07 +00:00
parent acdfbee4f9
commit e344b7df9c

View File

@@ -91,7 +91,8 @@ function sanitizeAntigravityThinkingBlocks(messages: AgentMessage[]): AgentMessa
out.push(msg); out.push(msg);
continue; continue;
} }
const nextContent = []; type AssistantContentBlock = Extract<AgentMessage, { role: "assistant" }>["content"][number];
const nextContent: AssistantContentBlock[] = [];
let contentChanged = false; let contentChanged = false;
for (const block of assistant.content) { for (const block of assistant.content) {
if ( if (
@@ -115,7 +116,11 @@ function sanitizeAntigravityThinkingBlocks(messages: AgentMessage[]): AgentMessa
continue; continue;
} }
if (rec.thinkingSignature !== candidate) { if (rec.thinkingSignature !== candidate) {
nextContent.push({ ...rec, thinkingSignature: candidate }); const nextBlock = {
...(block as unknown as Record<string, unknown>),
thinkingSignature: candidate,
} as AssistantContentBlock;
nextContent.push(nextBlock);
contentChanged = true; contentChanged = true;
} else { } else {
nextContent.push(block); nextContent.push(block);