From cced4823b157d9f144c9c17a915045efb02fff3a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 12 Mar 2026 01:25:52 -0400 Subject: [PATCH] Slack: share sent thread participation state --- src/slack/sent-thread-cache.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/slack/sent-thread-cache.ts b/src/slack/sent-thread-cache.ts index 7fe8037c797..653fc797418 100644 --- a/src/slack/sent-thread-cache.ts +++ b/src/slack/sent-thread-cache.ts @@ -7,7 +7,17 @@ const TTL_MS = 24 * 60 * 60 * 1000; // 24 hours const MAX_ENTRIES = 5000; -const threadParticipation = new Map(); +/** + * Keep Slack thread participation shared across bundled chunks so thread + * auto-reply gating does not diverge between prepare/dispatch call paths. + */ +const _g = globalThis as typeof globalThis & { + __openclaw_slack_thread_participation__?: Map; +}; +const threadParticipation = (_g.__openclaw_slack_thread_participation__ ??= new Map< + string, + number +>()); function makeKey(accountId: string, channelId: string, threadTs: string): string { return `${accountId}:${channelId}:${threadTs}`;