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: show error when agent dies mid-conversation instead of silent stop

Louis Beaumont9d327baffc27
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 378ade2ea..4d1c9f082 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -2095,15 +2095,17 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
}
console.log("[Pi] Process terminated, pid:", terminatedPid);
- // If a message was in flight, mark it as errored so the UI doesn't stay stuck
+ // If a message was in flight, append error to the message so the user
+ // knows the agent stopped unexpectedly (not just "completed").
if (piMessageIdRef.current) {
const msgId = piMessageIdRef.current;
setMessages((prev) =>
- prev.map((m) =>
- m.id === msgId && (m.content === "Processing..." || !m.content)
- ? { ...m, content: "AI agent crashed — restarting automatically..." }
- : m
- )
+ prev.map((m) => {
+ if (m.id !== msgId) return m;
+ const existing = m.content && m.content !== "Processing..." ? m.content : "";
+ const errorSuffix = "\n\n---\n\n⚠️ agent stopped unexpectedly — restarting automatically...";
+ return { ...m, content: existing + errorSuffix };
+ })
);
piStreamingTextRef.current = "";
piMessageIdRef.current = null;