From 2a9ef806a02a64a407ecbe9fc6b3b31730b1eef0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 13 Jan 2026 04:13:24 +0000 Subject: [PATCH] fix: strip only msg_* thought_signature (#805) (thanks @marcmarg) --- CHANGELOG.md | 1 + src/agents/pi-embedded-helpers.test.ts | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471ef8d39..c5034a749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Auto-reply: re-evaluate reasoning tag enforcement on fallback providers to prevent leaked reasoning. (#810 — thanks @mcinteerj) - Tools/Gemini: drop null-only union variants while cleaning tool schemas to avoid Cloud Code Assist schema errors. (#782 — thanks @AbhisekBasu1) - Connections UI: polish multi-account account cards in the Connections view. (#816 — thanks @steipete) +- Gemini: strip Claude `msg_*` thought_signature fields from session history to avoid base64 decode errors. (#805 — thanks @marcmarg) ## 2026.1.12-3 diff --git a/src/agents/pi-embedded-helpers.test.ts b/src/agents/pi-embedded-helpers.test.ts index 14f77c294..ae445fc11 100644 --- a/src/agents/pi-embedded-helpers.test.ts +++ b/src/agents/pi-embedded-helpers.test.ts @@ -9,12 +9,13 @@ import { isCloudCodeAssistFormatError, isCompactionFailureError, isContextOverflowError, + isMessagingToolDuplicate, isFailoverErrorMessage, + normalizeTextForComparison, sanitizeGoogleTurnOrdering, sanitizeSessionMessagesImages, sanitizeToolCallId, stripThoughtSignatures, - validateGeminiTurns, } from "./pi-embedded-helpers.js"; import { DEFAULT_AGENTS_FILENAME, @@ -591,9 +592,9 @@ describe("sanitizeSessionMessagesImages - thought_signature stripping", () => { const content = (out[0] as { content?: unknown[] }).content; expect(content).toHaveLength(2); expect("thought_signature" in ((content?.[0] ?? {}) as object)).toBe(false); - expect((content?.[1] as { thought_signature?: unknown })?.thought_signature).toBe( - "AQID", - ); + expect( + (content?.[1] as { thought_signature?: unknown })?.thought_signature, + ).toBe("AQID"); }); });