From 8c1d39064d50ab6e38b4cb650a4b08889be13654 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 10 Jan 2026 18:14:43 +0000 Subject: [PATCH] test: adjust tool id sanitization --- src/agents/pi-embedded-helpers.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/agents/pi-embedded-helpers.test.ts b/src/agents/pi-embedded-helpers.test.ts index 4272b2a35..42afca9e6 100644 --- a/src/agents/pi-embedded-helpers.test.ts +++ b/src/agents/pi-embedded-helpers.test.ts @@ -363,7 +363,7 @@ describe("sanitizeSessionMessagesImages", () => { expect((content as Array<{ type?: string }>)[0]?.type).toBe("toolCall"); }); - it("sanitizes tool ids for assistant blocks and tool results", async () => { + it("sanitizes tool ids for assistant blocks and tool results when enabled", async () => { const input = [ { role: "assistant", @@ -384,7 +384,9 @@ describe("sanitizeSessionMessagesImages", () => { }, ] satisfies AgentMessage[]; - const out = await sanitizeSessionMessagesImages(input, "test"); + const out = await sanitizeSessionMessagesImages(input, "test", { + sanitizeToolCallIds: true, + }); const assistant = out[0] as { content?: Array<{ id?: string }> }; expect(assistant.content?.[0]?.id).toBe("call_abc_item_123");