From 878a13d2150710a1eb95b83fbc7347499f8fbd35 Mon Sep 17 00:00:00 2001 From: nathandenherder Date: Thu, 5 Feb 2026 19:03:26 -0500 Subject: [PATCH] fix: don't consume replyPlan reference eagerly for streaming check The streaming check was calling replyPlan.nextThreadTs() at setup time to determine if a thread_ts existed, which consumed the first reference before the deliver callback ran. Use incomingThreadTs/statusThreadTs directly for the streaming eligibility check instead. --- src/slack/monitor/message-handler/dispatch.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slack/monitor/message-handler/dispatch.ts b/src/slack/monitor/message-handler/dispatch.ts index 4d8d54cd52e..60ac362ddcf 100644 --- a/src/slack/monitor/message-handler/dispatch.ts +++ b/src/slack/monitor/message-handler/dispatch.ts @@ -138,11 +138,13 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag // Slack native text streaming state // ----------------------------------------------------------------------- const streamingEnabled = account.config.streaming === true; - const replyThreadTs = replyPlan.nextThreadTs(); + + // Peek at the thread target without consuming it (for streaming check only). + const streamThreadHint = incomingThreadTs ?? statusThreadTs; const useStreaming = shouldUseStreaming({ streamingEnabled, - threadTs: replyThreadTs ?? incomingThreadTs ?? statusThreadTs, + threadTs: streamThreadHint, }); let streamSession: SlackStreamSession | null = null;