Fix deployment build: make WORLDMONITOR_API_KEY optional#217
Conversation
- Add missing WORLDMONITOR_API_KEY entry to SECRET_ANALYTICS_NAMES in analytics.ts to satisfy Record<RuntimeSecretKey, string> type - Remove cloud fallback gating on WORLDMONITOR_API_KEY presence in runtime.ts — the key is still sent as a header when available, but its absence no longer blocks cloud access https://claude.ai/code/session_01P6PjbxSWaagdFE55vPNFJg
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 901b04101c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (allowCloudFallback) { | ||
| try { | ||
| const { getSecretState, secretsReady } = await import('@/services/runtime-config'); | ||
| const { secretsReady } = await import('@/services/runtime-config'); | ||
| await Promise.race([secretsReady, new Promise<void>(r => setTimeout(r, 2000))]); |
There was a problem hiding this comment.
Restore API-key check before desktop cloud fallback
This block no longer checks whether WORLDMONITOR_API_KEY is present/valid before enabling cloud fallback, so desktop requests can now fall through to cloud without X-WorldMonitor-Key. The edge gateway still requires that header for desktop origins (api/_api-key.js, isDesktopOrigin branch), so when the local sidecar is down these calls deterministically become 401 responses instead of a controlled local-only failure path, making fallback effectively unusable for keyless desktop installs.
Useful? React with 👍 / 👎.
| } catch { | ||
| allowCloudFallback = false; | ||
| // secrets module failed to load — still allow cloud fallback | ||
| } |
There was a problem hiding this comment.
Block fallback when runtime-config import fails
Swallowing the runtime-config import failure here leaves allowCloudFallback enabled, but cloudFallback() still imports the same module for /api/*/v1/* requests to read WORLDMONITOR_API_KEY. If that chunk load is failing (for example after a stale deploy cache), fallback now throws a module-load error instead of returning the local response/error path, which is a new runtime failure mode introduced by this change.
Useful? React with 👍 / 👎.
analytics.ts to satisfy Record<RuntimeSecretKey, string> type
runtime.ts — the key is still sent as a header when available, but
its absence no longer blocks cloud access
https://claude.ai/code/session_01P6PjbxSWaagdFE55vPNFJg