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 2.7.39: recognize privileged workflow allowance [skip ci]

louise681fc3f44f4
diff --git a/apps/screenpipe-app-tauri/lib/workflows/access.test.ts b/apps/screenpipe-app-tauri/lib/workflows/access.test.ts
index 35aed1945..6892daf48 100644
--- a/apps/screenpipe-app-tauri/lib/workflows/access.test.ts
+++ b/apps/screenpipe-app-tauri/lib/workflows/access.test.ts
@@ -17,3 +17,15 @@ it("honors low-balance policy even when notification cooldown suppresses the toa
it("does not promise a daily reset for an unknown cost allowance window", () => {
expect(workflowAccess(usage({cost_limit_reached:true,resets_at:"2026-10-01T00:00:00Z"}))).toMatchObject({state:"paused",resetAt:undefined});
});
+
+it.each(["business_ultra", "super_admin"])("accepts gateway plan %s without bypassing allowance checks", (plan) => {
+ const snapshot = { hosted_ai: { plan } };
+ expect(workflowAccess(usage(snapshot)).state).toBe("ready");
+ expect(workflowAccess(usage({ ...snapshot, cost_limit_reached: true })).state).toBe("paused");
+ expect(workflowAccess(usage({ ...snapshot, cost_limit_reached: null })).state).toBe("unavailable");
+ expect(workflowAccess(usage({ ...snapshot, remaining: 0 })).state).toBe("paused");
+ expect(workflowAccess(usage({ ...snapshot, background_pipe_advisory: { reason: "background_pipe_allowance_low" } })).state).toBe("paused");
+});
+it.each(["free", "basic", "internal"])("does not grant workflows to %s", (plan) => {
+ expect(workflowAccess(usage({ hosted_ai: { plan } })).state).toBe("upgrade");
+});
diff --git a/apps/screenpipe-app-tauri/lib/workflows/access.ts b/apps/screenpipe-app-tauri/lib/workflows/access.ts
index c49d3bfd6..a517657e2 100644
--- a/apps/screenpipe-app-tauri/lib/workflows/access.ts
+++ b/apps/screenpipe-app-tauri/lib/workflows/access.ts
@@ -2,9 +2,11 @@
// https://screenpipe.com
import type { UsageStatus } from "@/lib/hooks/use-usage-status";
export function workflowAccess(usage: UsageStatus | null) {
+ // The gateway reports its privileged allowance as super_admin, not a billing tier.
+ // Trust only the authenticated usage response; never infer this from local user settings.
const plan = usage?.hosted_ai?.plan;
if (!plan || plan === "unknown") return { state: "unavailable", message: "Reconnect to check workflow access and AI allowance." } as const;
- if (!["business", "business_max", "business_ultra", "pro", "pro_max", "pro_ultra", "team", "enterprise"].includes(plan)) return { state: "upgrade", message: "Automatic workflow discovery is included with Business. Your saved workflows remain available." } as const;
+ if (!["business", "business_max", "business_ultra", "pro", "pro_max", "pro_ultra", "team", "enterprise", "super_admin"].includes(plan)) return { state: "upgrade", message: "Automatic workflow discovery is included with Business. Your saved workflows remain available." } as const;
const advisory = usage?.background_pipe_advisory;
if (usage?.cost_limit_reached || (usage && usage.remaining <= 0) || advisory?.reason === "background_pipe_allowance_low") return { state: "paused", message: usage?.cost_limit_reached || usage?.remaining === 0 ? "Workflow updates are paused because your AI allowance is used up." : "Workflow updates are paused to preserve AI allowance for chat.", resetAt: advisory?.reset_at ?? (usage?.cost_limit_reached ? usage.hosted_ai?.allowances?.find(a => a.remaining_percent === 0)?.resets_at : usage?.resets_at) } as const;
if (usage?.cost_limit_reached == null) return { state: "unavailable", message: "AI allowance is unavailable. Your saved workflows are still accessible." } as const;
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index e0eac8594..2888fef7f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -11188,7 +11188,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.7.38"
+version = "2.7.39"
dependencies = [
"aes 0.8.4",
"aes-gcm 0.10.3",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 5f047129f..911840604 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -7,7 +7,7 @@ members = ["wer-dump-helper", "windows/persistence-supervisor"]
[package]
name = "screenpipe-app"
-version = "2.7.38"
+version = "2.7.39"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/crates/screenpipe-core/src/workflows/pipeline.rs b/crates/screenpipe-core/src/workflows/pipeline.rs
index 851681111..249ac652a 100644
--- a/crates/screenpipe-core/src/workflows/pipeline.rs
+++ b/crates/screenpipe-core/src/workflows/pipeline.rs
@@ -54,6 +54,8 @@ pub fn admission(usage: &Value) -> Result<(), (&'static str, &'static str)> {
"Could not verify workflow access. Reconnect and try again.",
));
}
+ // Match the gateway's privileged allowance label as well as paid billing tiers.
+ // check_admission obtains this value from the authenticated gateway response.
if !matches!(
plan,
"business"
@@ -64,6 +66,7 @@ pub fn admission(usage: &Value) -> Result<(), (&'static str, &'static str)> {
| "pro_ultra"
| "team"
| "enterprise"
+ | "super_admin"
) {
return Err(("workflow_business_required", "Automatic workflow discovery requires Business. Your saved workflows are still available."));
}
@@ -247,6 +250,39 @@ mod tests {
assert!(has_pending_input(&task).await.unwrap());
assert_eq!(server.received_requests().await.unwrap().len(), 1);
}
+ #[test]
+ fn privileged_gateway_plan_retains_all_admission_checks() {
+ for plan in ["business_ultra", "super_admin"] {
+ let mut usage =
+ json!({"hosted_ai":{"plan":plan},"remaining":100,"cost_limit_reached":false});
+ assert!(admission(&usage).is_ok(), "{plan}");
+ usage["cost_limit_reached"] = json!(true);
+ assert_eq!(
+ admission(&usage).unwrap_err().0,
+ "workflow_allowance_paused"
+ );
+ usage["cost_limit_reached"] = Value::Null;
+ assert_eq!(
+ admission(&usage).unwrap_err().0,
+ "workflow_usage_unavailable"
+ );
+ usage["cost_limit_reached"] = json!(false);
+ usage["background_pipe_advisory"] = json!({"reason":"background_pipe_allowance_low"});
+ assert_eq!(
+ admission(&usage).unwrap_err().0,
+ "workflow_allowance_paused"
+ );
+ }
+ for plan in ["free", "basic", "internal"] {
+ let usage =
+ json!({"hosted_ai":{"plan":plan},"remaining":100,"cost_limit_reached":false});
+ assert_eq!(
+ admission(&usage).unwrap_err().0,
+ "workflow_business_required"
+ );
+ }
+ }
+
#[test]
fn gates_background_work_without_interpreting_unknown_as_empty() {
let mut u =