Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: suppress Pi first-call startsWith error in chat UI (pi-mono#2461)

Louis Beaumontd5f26fa6a6e7
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 2dbb2a520..837b37c6a 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -2010,6 +2010,13 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
}
} else if (data.type === "response" && data.success === false) {
const errorStr = data.error || "Unknown error";
+ // Suppress Pi agent first-call bug (pi-mono#2461) — the warmup
+ // prompt absorbs this crash, but the error event still fires.
+ // Pi auto-retries and the next call works.
+ if (errorStr.includes("startsWith") || errorStr.includes("text.startsWith")) {
+ console.warn("[Pi] suppressing known first-call bug:", errorStr);
+ return;
+ }
if (piMessageIdRef.current) {
const msgId = piMessageIdRef.current;