Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(slack): rt clause-1 — refuse app/voice sends without an explicit channel+thread

Chaitanya Giri534f416ee9a1
diff --git a/src/main/index.ts b/src/main/index.ts
index 4704ad4b..5ac71d97 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -2721,6 +2721,12 @@ ipcMain.handle('slack:reply', (_evt, arg: unknown) => {
if (typeof p.channel !== 'string' || typeof p.thread_ts !== 'string' || typeof p.text !== 'string') {
return { ok: false, error: 'channel, thread_ts, text required' };
}
+ // CLAUSE-1 (fix-slack-integration): an app-initiated send must target an
+ // EXPLICIT thread — reject a blank/whitespace channel or thread rather than
+ // letting it fall through to an implicit destination (the channel root).
+ if (!p.channel.trim() || !p.thread_ts.trim()) {
+ return { ok: false, error: 'explicit channel + thread_ts required' };
+ }
return postSlackReply({ botToken, channel: p.channel, thread_ts: p.thread_ts, text: p.text });
});
ipcMain.handle('slack:setConfig', (_evt, patch: unknown) => {
diff --git a/src/main/slack.ts b/src/main/slack.ts
index 5b12888b..b99495ad 100644
--- a/src/main/slack.ts
+++ b/src/main/slack.ts
@@ -358,6 +358,15 @@ export function postSlackReply(opts: {
}): Promise<{ ok: boolean; error?: string }> {
return new Promise((resolve) => {
if (!opts.botToken) { resolve({ ok: false, error: 'missing bot token' }); return; }
+ // CLAUSE-1 guard (fix-slack-integration): refuse any send that lacks an
+ // EXPLICIT channel + thread target. A blank/whitespace thread_ts would post
+ // to the channel root — an implicit destination the caller never named — so
+ // every app/voice-initiated send must pass the thread it was explicitly given.
+ // The Slack-origin done-reply poller and the loopback /reply endpoint always
+ // pass concrete values, so this never fires for them (no behaviour change).
+ if (!opts.channel?.trim() || !opts.thread_ts?.trim()) {
+ resolve({ ok: false, error: 'missing explicit channel or thread_ts' }); return;
+ }
const body = JSON.stringify({ channel: opts.channel, thread_ts: opts.thread_ts, text: opts.text });
const req = httpsRequest({
method: 'POST',