fix(ai): preserve unsigned tool call context for Gemini 3 with anti-mimicry note

Instead of skipping unsigned tool calls entirely (which lobotomizes context),
convert them to text with an explicit note telling the model this is historical
context from a different model and not a format to mimic.

This preserves tool call/result context when switching from providers without
thought signatures (e.g. Claude via Antigravity) to Gemini 3.
This commit is contained in:
Mario Zechner 2026-01-16 23:42:39 +01:00
parent 1405e30492
commit 5d3e7d5aaa
2 changed files with 6 additions and 2 deletions

View file

@ -63,7 +63,10 @@ describe("google-shared convertMessages", () => {
expect(toolTurn?.parts?.some((p) => p.functionCall !== undefined)).toBe(false);
const text = toolTurn?.parts?.map((p) => p.text ?? "").join("\n");
expect(text).toContain("[Tool Call: bash]");
// Should contain historical context note to prevent mimicry
expect(text).toContain("Historical context");
expect(text).toContain("bash");
expect(text).toContain("ls -la");
expect(text).toContain("Do not mimic this format");
});
});