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: retry API config init until key is available, not just auth_enabled

Louis Beaumont89fbf988cce6
diff --git a/apps/screenpipe-app-tauri/lib/api.ts b/apps/screenpipe-app-tauri/lib/api.ts
index f41eabffd..37b3e1bb2 100644
--- a/apps/screenpipe-app-tauri/lib/api.ts
+++ b/apps/screenpipe-app-tauri/lib/api.ts
@@ -58,8 +58,9 @@ function ensureInitialized(): Promise<void> {
_apiKey = config.key;
_authEnabled = config.auth_enabled;
- // If auth is enabled but key is missing, server isn't ready yet — retry
- if (_authEnabled && !_apiKey) {
+ // Server not ready yet: either auth_enabled=false (server state not
+ // available) or key is null. Retry until we get a real config.
+ if (!_apiKey) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
continue;
}