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

feat: show pipe errors inline with upgrade CTA on daily limit

Louis Beaumont038878d24f18
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index a0954acb0..199069c0c 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -20,6 +20,39 @@ import { Label } from "@/components/ui/label";
import { Badge } from "@/components/ui/badge";
import { homeDir, join } from "@tauri-apps/api/path";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
+import { openUrl } from "@tauri-apps/plugin-opener";
+
+function parsePipeError(stderr: string): {
+ type: "daily_limit" | "rate_limit" | "unknown";
+ message: string;
+ used?: number;
+ limit?: number;
+ resets_at?: string;
+} {
+ // stderr format: '429 "{...json...}"\n'
+ const jsonMatch = stderr.match(/\d{3}\s+"(.+)"/s);
+ if (jsonMatch) {
+ try {
+ const parsed = JSON.parse(jsonMatch[1]);
+ if (parsed.error === "daily_limit_exceeded") {
+ return {
+ type: "daily_limit",
+ message: `daily limit reached (${parsed.used_today}/${parsed.limit_today})`,
+ used: parsed.used_today,
+ limit: parsed.limit_today,
+ resets_at: parsed.resets_at,
+ };
+ }
+ if (parsed.error === "rate limit exceeded") {
+ return {
+ type: "rate_limit",
+ message: `rate limited — retrying automatically`,
+ };
+ }
+ } catch {}
+ }
+ return { type: "unknown", message: stderr.slice(0, 150) };
+}
interface PipeConfig {
name: string;
@@ -38,6 +71,7 @@ interface PipeStatus {
last_success: boolean | null;
is_running: boolean;
prompt_body: string;
+ last_error: string | null;
}
interface PipeRunLog {
@@ -236,6 +270,41 @@ export function PipesSection() {
/>
</div>
+ {/* Error banner */}
+ {pipe.last_success === false && pipe.last_error && (() => {
+ const error = parsePipeError(pipe.last_error);
+ if (error.type === "daily_limit") {
+ return (
+ <div className="mt-2 flex items-center gap-2 text-xs">
+ <span className="text-orange-500">
+ {error.message}
+ {error.resets_at && (
+ <> · resets {new Date(error.resets_at).toLocaleTimeString()}</>
+ )}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-6 text-[11px] px-2"
+ onClick={() => openUrl("https://screenpi.pe/onboarding?tab=pricing")}
+ >
+ get more queries →
+ </Button>
+ </div>
+ );
+ }
+ if (error.type === "rate_limit") {
+ return (
+ <p className="mt-2 text-xs text-yellow-500">{error.message}</p>
+ );
+ }
+ return (
+ <p className="mt-2 text-xs text-red-500 truncate max-w-full">
+ {error.message}
+ </p>
+ );
+ })()}
+
{/* Expanded detail */}
{expanded === pipe.config.name && (
<div className="mt-4 space-y-4 border-t pt-4">
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index c617787fe..7ee4d4e5e 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -76,6 +76,8 @@ pub struct PipeStatus {
pub is_running: bool,
/// Raw prompt body (below front-matter).
pub prompt_body: String,
+ /// Last error message (stderr from most recent failed run).
+ pub last_error: Option<String>,
}
// ---------------------------------------------------------------------------
@@ -176,12 +178,16 @@ impl PipeManager {
.map(|(name, (config, body))| {
let pipe_logs = logs.get(name);
let last_log = pipe_logs.and_then(|l| l.back());
+ let last_error = last_log
+ .filter(|l| !l.success)
+ .map(|l| l.stderr.clone());
PipeStatus {
config: config.clone(),
last_run: last_log.map(|l| l.finished_at),
last_success: last_log.map(|l| l.success),
is_running: running.contains_key(name),
prompt_body: body.clone(),
+ last_error,
}
})
.collect()
@@ -196,12 +202,16 @@ impl PipeManager {
pipes.get(name).map(|(config, body)| {
let pipe_logs = logs.get(name);
let last_log = pipe_logs.and_then(|l| l.back());
+ let last_error = last_log
+ .filter(|l| !l.success)
+ .map(|l| l.stderr.clone());
PipeStatus {
config: config.clone(),
last_run: last_log.map(|l| l.finished_at),
last_success: last_log.map(|l| l.success),
is_running: running.contains_key(name),
prompt_body: body.clone(),
+ last_error,
}
})
}