Common Issues.

Agent not responding / Demo Mode

Add your Anthropic API key in Settings → API Keys. The key is stored in users.preferences.anthropicApiKey. The chat route resolves keys in order: platform key → BYOK key → demo mode. If you have added a key and still see demo mode, check that it starts with sk-ant- and has not expired.

Backend returning 503 or timing out

Cloudflare Workers have a 30-second CPU time limit. Long-running agent tasks (complex multi-tool chains) may hit this limit. The streaming endpoint (/api/chat/stream) is more resilient — it starts sending tokens immediately. Check /health to verify the backend is operational.

Credits not updating after a conversation

Credit deduction is synchronous — it happens before the response is returned. If your balance looks stale, hard-refresh the Credits page. The credit_transactions table is the source of truth. If a transaction is missing, the AI call may have failed before completing.

Workspace files not loading in conversations

Workspace files are loaded via buildWorkspaceContext() which queries workspace_files WHERE userId = ? AND isActive = true. If files are not loading, check that they have isActive: true in the database. Re-upload via Settings → Workspace if needed.

Login issues / Firebase errors

Clear browser cache and cookies. Ensure popups are not blocked (Google OAuth uses a popup). If you see "auth/network-request-failed", check your internet connection. Firebase tokens expire after 1 hour — the frontend refreshes them automatically, but a hard refresh fixes stale token errors.