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(defaults): power-mode Auto by default; readable chat-load errors (#3502)

Louis Beaumontb2a9f8bbf842
diff --git a/apps/screenpipe-app-tauri/components/settings/intercom-chat.tsx b/apps/screenpipe-app-tauri/components/settings/intercom-chat.tsx
index 3fc22219d..d14bb36bc 100644
--- a/apps/screenpipe-app-tauri/components/settings/intercom-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/intercom-chat.tsx
@@ -42,6 +42,17 @@ function stripHtml(html: string): string {
return div.textContent || div.innerText || "";
}
+// WebKit returns `TypeError: Load failed` when the chat backend is unreachable,
+// which surfaces as the opaque "Load failed (screenpi.pe)" line. Swap any
+// connection-style failure for an actionable message; pass others through.
+function describeChatError(e: unknown): string {
+ const msg = (e instanceof Error ? e.message : String(e)) || "";
+ if (/load failed|failed to fetch|networkerror|network request failed/i.test(msg)) {
+ return "chat is temporarily unreachable — please try again in a moment, or email [email protected]";
+ }
+ return msg || "failed to send message";
+}
+
export function IntercomChat() {
const { settings } = useSettings();
const [messages, setMessages] = useState<Message[]>([]);
@@ -149,7 +160,7 @@ export function IntercomChat() {
]);
}
} catch (err: any) {
- setError(err.message || "failed to send message");
+ setError(describeChatError(err));
setInput(body);
} finally {
setSending(false);
diff --git a/crates/screenpipe-engine/src/power/profile.rs b/crates/screenpipe-engine/src/power/profile.rs
index 205c969ad..ca3744168 100644
--- a/crates/screenpipe-engine/src/power/profile.rs
+++ b/crates/screenpipe-engine/src/power/profile.rs
@@ -16,9 +16,9 @@ use serde::{Deserialize, Serialize};
#[derive(Default)]
pub enum PowerMode {
/// Automatically switch based on battery state.
+ #[default]
Auto,
/// Always use full performance (ignore battery).
- #[default]
Performance,
/// Always use battery saver (even on AC).
BatterySaver,