Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

fix(console): record why the managed stack sets no messaging-app vars

Petr Bauch61885b1def61
diff --git a/console/apps/switch-console-desktop/src/main/core/managed-switch-server/env-file.test.ts b/console/apps/switch-console-desktop/src/main/core/managed-switch-server/env-file.test.ts
index c0d3bdc82..63ca8994a 100644
--- a/console/apps/switch-console-desktop/src/main/core/managed-switch-server/env-file.test.ts
+++ b/console/apps/switch-console-desktop/src/main/core/managed-switch-server/env-file.test.ts
@@ -90,9 +90,24 @@ describe('buildEnvFile', () => {
const interpolated = new Set(
[...composeBody.matchAll(/\$\{([A-Z_][A-Z0-9_]*)/g)].map((m) => m[1])
);
- // Nothing is exempt today. An entry here must say why the stack is correct
- // without it — leaving a var unset is a decision, not a default.
- const intentionallyUnset = new Set<string>();
+ // An entry here must say why the stack is correct without it — leaving a
+ // var unset is a decision, not a default.
+ const intentionallyUnset = new Set<string>([
+ // The four below configure switch-core as a distributed messaging app —
+ // one app we own, installed by a customer into their own workspace, with
+ // the platform posting events to URLs declared once in the app manifest.
+ // A managed stack cannot be one of those and is not meant to be: it binds
+ // to loopback, so no platform can reach its callback or event URLs, and
+ // the credentials are the app owner's rather than anything this machine
+ // could hold. switch-core registers no installer without them and the
+ // operator UI says so rather than offering a button that would fail at
+ // Slack. Connecting a workspace from here is the other path — an operator
+ // registering a bridge with their own app's token.
+ 'MESSAGING_PUBLIC_URL',
+ 'SLACK_APP_CLIENT_ID',
+ 'SLACK_APP_CLIENT_SECRET',
+ 'SLACK_APP_SIGNING_SECRET',
+ ]);
const missing = [...interpolated]
.filter((key) => !intentionallyUnset.has(key))