fix: preserve antigravity thinking block types
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user