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: prevent agent_end from overwriting rate limit error messages with 'Done'

Louis Beaumont6910105fb230
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 966bbc083..78cfb1fd8 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -1132,7 +1132,14 @@ export function StandaloneChat() {
// Check if content was already set by error handlers above
setMessages((prev) => {
const existing = prev.find((m) => m.id === msgId);
- // Don't overwrite meaningful error messages with "Done"
+ // Don't overwrite error messages with "Done" or empty content
+ const isErrorMessage = existing?.content?.includes("used all your free queries") ||
+ existing?.content?.includes("requires an upgrade") ||
+ existing?.content?.startsWith("Error:");
+ if (isErrorMessage) {
+ return prev;
+ }
+ // Don't overwrite if we have no new content and existing isn't "Processing..."
if (existing && existing.content !== "Processing..." && !content) {
return prev;
}