You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(chat): gate the UI on NEXT_PUBLIC_CHAT_DISABLED, not an opt-in flag
CHAT_ENABLED made Chat opt-in, so every existing deployment that already had
COPILOT_API_KEY would have lost the module until it set a new variable. Invert
to an opt-out so nothing changes for them.
That also collapses the twin. The only reason the flag needed a server/client
pair was that it projected a secret; NEXT_PUBLIC_CHAT_DISABLED is not one, so
getEnv resolves the same value from process.env on the server and window.__ENV
in the browser. Gone with it: the FLAG_TWINS entry and its doctor sync check,
the two-variable wizard write, and the boot-time throw, whose contradiction
(flag on, key absent) can no longer be expressed.
Presentation and capability are now separate concerns. NEXT_PUBLIC_CHAT_DISABLED
decides whether the surfaces render; COPILOT_API_KEY decides whether the work
can run, and gates the paths that need it — the Sim Chat block, prompt-job
claims, and inbox access — each failing on its own terms.
The wizard writes the opt-out when you skip the chat key, which is the case this
started from: a fresh self-host that never configured Chat.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ErcRgvi7VQBeKDQ3MBMha
|`COPILOT_API_KEY`| API key for Chat. Required whenever `CHAT_ENABLED` is set — the app refuses to start without it |
68
-
|`CHAT_ENABLED`| Shows the Chat module. Leave unset and the workspace lands on your first workflow, with no chats list, scheduled tasks, editor Chat panel, or Sim Chat block |
69
-
|`NEXT_PUBLIC_CHAT_ENABLED`| Browser twin of `CHAT_ENABLED`. Set both together (`bun run setup` does) |
67
+
|`COPILOT_API_KEY`| API key for Chat. Without it the Sim Chat block, scheduled prompt jobs, and Inbox cannot run |
68
+
|`NEXT_PUBLIC_CHAT_DISABLED`| Set to `true` to hide the Chat module: the workspace lands on your first workflow, with no chats list, scheduled tasks, or editor Chat panel. Chat is shown when unset; `bun run setup` sets it for you if you skip the chat key |
70
69
|`ADMIN_API_KEY`| Admin API key for GitOps operations |
71
70
|`ALLOWED_LOGIN_DOMAINS`| Restrict signups to domains (comma-separated) |
72
71
|`ALLOWED_LOGIN_EMAILS`| Restrict signups to specific emails (comma-separated) |
# AUTH_TRUSTED_PROXIES=10.0.0.0/24,192.0.2.10 # Optional: reverse-proxy IPs/CIDRs in front of the app. Better Auth walks x-forwarded-for right to left, skips these hops, and uses the first untrusted address as the client IP (prevents forwarded-header spoofing). Use your proxies' actual addresses, not broad private ranges that also cover clients.
23
23
24
24
# Chat (Optional)
25
-
# Leave these unset and the Chat module is hidden entirely: the workspace lands
26
-
# on your first workflow, and the chats list, scheduled tasks, workflow-editor
27
-
# Chat panel, and Sim Chat block are all absent. `bun run setup` writes all three
28
-
# together; set them by hand only if you skip the wizard.
29
-
# COPILOT_API_KEY= # Mint one at https://sim.ai — required whenever CHAT_ENABLED is true (the app refuses to boot otherwise)
30
-
# CHAT_ENABLED=true # Server-side gate
31
-
# NEXT_PUBLIC_CHAT_ENABLED=true # Browser twin — must match CHAT_ENABLED
25
+
# COPILOT_API_KEY= # Mint one at https://sim.ai. Without it the Sim Chat block, prompt jobs, and Inbox cannot run
26
+
# NEXT_PUBLIC_CHAT_DISABLED=true # Hides the Chat module: the workspace lands on your first workflow, and the chats list, scheduled tasks, and editor Chat panel are absent. Chat is shown when unset; `bun run setup` sets this for you if you skip the chat key
32
27
33
28
# Security (Required)
34
29
ENCRYPTION_KEY=your_encryption_key# Use `openssl rand -hex 32` to generate, used to encrypt environment variables
'CHAT_ENABLED is set without COPILOT_API_KEY — Chat would render against a backend that rejects every request. Set COPILOT_API_KEY, or unset CHAT_ENABLED and NEXT_PUBLIC_CHAT_ENABLED.'
21
-
)
22
-
}
23
9
// `server.js` is the Next standalone build artifact, a sibling of this file in
24
10
// the image; it does not exist at type-check time, so the specifier is held in a
25
11
// variable to keep it out of static module resolution.
0 commit comments