Skip to content

Fix deployment build: make WORLDMONITOR_API_KEY optional#217

Merged
koala73 merged 2 commits into
mainfrom
claude/fix-deployment-api-key-1oQnd
Feb 21, 2026
Merged

Fix deployment build: make WORLDMONITOR_API_KEY optional#217
koala73 merged 2 commits into
mainfrom
claude/fix-deployment-api-key-1oQnd

Conversation

@koala73

@koala73 koala73 commented Feb 21, 2026

Copy link
Copy Markdown
Owner
  • 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

- 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
@vercel

vercel Bot commented Feb 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Feb 21, 2026 1:55pm
worldmonitor-finance Ready Ready Preview, Comment Feb 21, 2026 1:55pm
worldmonitor-startup Ready Ready Preview, Comment Feb 21, 2026 1:55pm

Request Review

@koala73
koala73 merged commit e882a00 into main Feb 21, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/services/runtime.ts
Comment on lines 223 to 226
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))]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/services/runtime.ts
Comment on lines 227 to 229
} catch {
allowCloudFallback = false;
// secrets module failed to load — still allow cloud fallback
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@koala73
koala73 deleted the claude/fix-deployment-api-key-1oQnd branch February 23, 2026 07:09
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants