From 5c2eedc3407259ca932016e99e853217c2125f22 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 14 Jan 2026 15:01:50 +0100 Subject: [PATCH] test: add thought tag stripping test case --- src/agents/pi-embedded-utils.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/agents/pi-embedded-utils.test.ts b/src/agents/pi-embedded-utils.test.ts index 3e3d56a5e..a3d322757 100644 --- a/src/agents/pi-embedded-utils.test.ts +++ b/src/agents/pi-embedded-utils.test.ts @@ -423,6 +423,22 @@ File contents here`, expect(result).toBe("The actual answer."); }); + it("strips thought tags", () => { + const msg: AssistantMessage = { + role: "assistant", + content: [ + { + type: "text", + text: "Internal deliberationFinal response.", + }, + ], + timestamp: Date.now(), + }; + + const result = extractAssistantText(msg); + expect(result).toBe("Final response."); + }); + it("handles nested or multiple thinking blocks", () => { const msg: AssistantMessage = { role: "assistant",