From 47634c294d787f99a1e32e75fbe7e33e50bdde21 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 15 Jan 2026 06:08:17 +0000 Subject: [PATCH] style: format pi embedded utils --- src/agents/pi-embedded-utils.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/agents/pi-embedded-utils.ts b/src/agents/pi-embedded-utils.ts index 814221a28..f63d48c8a 100644 --- a/src/agents/pi-embedded-utils.ts +++ b/src/agents/pi-embedded-utils.ts @@ -64,12 +64,12 @@ function stripDowngradedToolCallText(text: string): string { escape = false; } else if (ch === "\\") { escape = true; - } else if (ch === "\"") { + } else if (ch === '"') { inString = false; } continue; } - if (ch === "\"") { + if (ch === '"') { inString = true; continue; } @@ -85,7 +85,7 @@ function stripDowngradedToolCallText(text: string): string { return null; } - if (startChar === "\"") { + if (startChar === '"') { let escape = false; for (let i = index + 1; i < input.length; i += 1) { const ch = input[i]; @@ -97,7 +97,7 @@ function stripDowngradedToolCallText(text: string): string { escape = true; continue; } - if (ch === "\"") return i + 1; + if (ch === '"') return i + 1; } return null; } @@ -154,10 +154,7 @@ function stripDowngradedToolCallText(text: string): string { let cleaned = stripToolCalls(text); // Remove [Tool Result for ID ...] blocks and their content. - cleaned = cleaned.replace( - /\[Tool Result for ID[^\]]*\]\n?[\s\S]*?(?=\n*\[Tool |\n*$)/gi, - "", - ); + cleaned = cleaned.replace(/\[Tool Result for ID[^\]]*\]\n?[\s\S]*?(?=\n*\[Tool |\n*$)/gi, ""); return cleaned.trim(); }