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

Bump app to v2.4.50 — clearer cost-cap error

Louis Beaumontee6293f6f8e2
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 7ef1675fa..0021ca892 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -95,7 +95,15 @@ function buildDailyLimitMessage(errorStr: string): string {
}
if (isCostLimit) {
- return "Daily usage limit reached for this model. Try a lighter model or wait until tomorrow.";
+ // Surface the actual spent / cap figures when the gateway returns them
+ // so the user sees "$39.50 of $35 today" and knows it's the account-wide
+ // budget (often hit by background pipes), not a per-model limit.
+ const spent = errorStr.match(/"spent_today_usd":\s*([\d.]+)/)?.[1];
+ const cap = errorStr.match(/"cost_cap_usd":\s*([\d.]+)/)?.[1];
+ if (spent && cap) {
+ return `You've spent $${spent} of your $${cap} daily AI budget (resets at midnight UTC). This is an account-wide limit — background pipes consume it too. Try a free model (gemini-3-flash, haiku) or disable noisy pipes at Settings → Pipes.`;
+ }
+ return "You've hit your daily AI budget. Try a free model (gemini-3-flash, haiku) or wait until midnight UTC.";
}
const tierMatch = errorStr.match(/"tier":\s*"([^"]+)"/);
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 4a35d418c..912cdd1c1 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.4.49"
+version = "2.4.50"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/packages/ai-gateway/src/index.ts b/packages/ai-gateway/src/index.ts
index ede4527be..fc03a26ee 100644
--- a/packages/ai-gateway/src/index.ts
+++ b/packages/ai-gateway/src/index.ts
@@ -54,6 +54,8 @@ async function handleRequest(request: Request, env: Env, ctx: ExecutionContext):
const enriched = {
...status,
cost_limit_reached: dailyCost >= maxCost,
+ spent_today_usd: Number(dailyCost.toFixed(2)),
+ cost_cap_usd: Number(maxCost.toFixed(2)),
};
return addCorsHeaders(createSuccessResponse(enriched));
}
@@ -104,10 +106,16 @@ async function handleRequest(request: Request, env: Env, ctx: ExecutionContext):
const dailyCost = await getDailyUserCost(env, authResult.deviceId);
const maxCost = getTierDailyCostCap(authResult.tier, env);
if (dailyCost >= maxCost) {
+ const resetsAt = new Date();
+ resetsAt.setUTCHours(24, 0, 0, 0);
return addCorsHeaders(createErrorResponse(429, JSON.stringify({
error: 'daily_cost_limit_exceeded',
- message: `You've reached your daily AI usage limit. Try a free model or wait until tomorrow.`,
- free_models: ['gemini-3-flash'],
+ message: `You've used $${dailyCost.toFixed(2)} of your $${maxCost.toFixed(2)} daily AI budget (resets at midnight UTC). Switch to a free model (gemini-3-flash, qwen3.5-flash) or wait until tomorrow.`,
+ spent_today_usd: Number(dailyCost.toFixed(2)),
+ cost_cap_usd: Number(maxCost.toFixed(2)),
+ resets_at: resetsAt.toISOString(),
+ tier: authResult.tier,
+ free_models: ['gemini-3-flash', 'qwen3.5-flash', 'claude-haiku-4-5'],
})));
}
}
@@ -339,10 +347,16 @@ async function handleRequest(request: Request, env: Env, ctx: ExecutionContext):
const dailyCost = await getDailyUserCost(env, authResult.deviceId);
const maxCost = getTierDailyCostCap(authResult.tier, env);
if (dailyCost >= maxCost) {
+ const resetsAt = new Date();
+ resetsAt.setUTCHours(24, 0, 0, 0);
return addCorsHeaders(createErrorResponse(429, JSON.stringify({
error: 'daily_cost_limit_exceeded',
- message: `You've reached your daily AI usage limit. Try a free model or wait until tomorrow.`,
- free_models: ['gemini-3-flash'],
+ message: `You've used $${dailyCost.toFixed(2)} of your $${maxCost.toFixed(2)} daily AI budget (resets at midnight UTC). Switch to a free model (gemini-3-flash, qwen3.5-flash) or wait until tomorrow.`,
+ spent_today_usd: Number(dailyCost.toFixed(2)),
+ cost_cap_usd: Number(maxCost.toFixed(2)),
+ resets_at: resetsAt.toISOString(),
+ tier: authResult.tier,
+ free_models: ['gemini-3-flash', 'qwen3.5-flash', 'claude-haiku-4-5'],
})));
}
}
@@ -438,10 +452,16 @@ async function handleRequest(request: Request, env: Env, ctx: ExecutionContext):
const dailyCost = await getDailyUserCost(env, authResult.deviceId);
const maxCost = getTierDailyCostCap(authResult.tier, env);
if (dailyCost >= maxCost) {
+ const resetsAt = new Date();
+ resetsAt.setUTCHours(24, 0, 0, 0);
return addCorsHeaders(createErrorResponse(429, JSON.stringify({
error: 'daily_cost_limit_exceeded',
- message: `You've reached your daily AI usage limit. Try a free model or wait until tomorrow.`,
- free_models: ['gemini-3-flash'],
+ message: `You've used $${dailyCost.toFixed(2)} of your $${maxCost.toFixed(2)} daily AI budget (resets at midnight UTC). Switch to a free model (gemini-3-flash, qwen3.5-flash) or wait until tomorrow.`,
+ spent_today_usd: Number(dailyCost.toFixed(2)),
+ cost_cap_usd: Number(maxCost.toFixed(2)),
+ resets_at: resetsAt.toISOString(),
+ tier: authResult.tier,
+ free_models: ['gemini-3-flash', 'qwen3.5-flash', 'claude-haiku-4-5'],
})));
}
}