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: stop Pi idle-watchdog from triggering infinite restart loop

Louis Beaumont3da195e19bf4
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 20640cc60..6ce38aa3f 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -1644,6 +1644,13 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const terminatedPid = event.payload;
console.log("[Pi] Process terminated, pid:", terminatedPid, "restart count:", piRestartCountRef.current);
+ // pid=0 means the idle watchdog stopped Pi to save resources — don't auto-restart
+ if (terminatedPid === 0) {
+ console.log("[Pi] Idle watchdog stopped Pi, skipping auto-restart");
+ setPiInfo(null);
+ return;
+ }
+
// If a message was in flight, mark it as errored so the UI doesn't stay stuck
if (piMessageIdRef.current) {
const msgId = piMessageIdRef.current;