From 4363e435eb3ed8f3c7d732799ee031398dbf19cf Mon Sep 17 00:00:00 2001 From: Jonathan Tsai Date: Mon, 26 Jan 2026 23:37:46 -0800 Subject: [PATCH] fix(slack): add reactionNotifications config check to reactions handler The Slack reactions handler was processing all reactions unconditionally, ignoring the reactionNotifications config setting. This adds the same filtering logic that exists in Telegram/Discord/Signal: - Check reactionMode config (off/own/all/allowlist) - Skip bot's own reactions - For 'own' mode, only process reactions on messages sent by the bot - For 'allowlist' mode, only process reactions from allowlisted users Fixes reactions not being routed to agent sessions when configured. --- src/slack/monitor/events/reactions.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/slack/monitor/events/reactions.ts b/src/slack/monitor/events/reactions.ts index ec859051f..ac64ea61d 100644 --- a/src/slack/monitor/events/reactions.ts +++ b/src/slack/monitor/events/reactions.ts @@ -12,6 +12,26 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext } const handleReactionEvent = async (event: SlackReactionEvent, action: string) => { try { + // Check reactionNotifications config (consistent with Telegram/Discord/Signal) + const reactionMode = ctx.reactionMode ?? "own"; + if (reactionMode === "off") return; + + // Skip bot reactions (consistent with other providers) + if (event.user === ctx.botUserId) return; + + // For "own" mode, only process reactions on messages sent by this bot + if (reactionMode === "own" && event.item_user !== ctx.botUserId) return; + + // For "allowlist" mode, only process reactions from allowlisted users + if (reactionMode === "allowlist") { + const allowlist = ctx.reactionAllowlist ?? []; + if (allowlist.length === 0) return; + const userAllowed = allowlist.some( + (entry) => String(entry).toLowerCase() === String(event.user).toLowerCase(), + ); + if (!userAllowed) return; + } + const item = event.item; if (!item || item.type !== "message") return;