From 22d8d8c1cfe69b375289c2f6499de9ef17c28a7e Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Fri, 2 Jan 2026 19:05:08 -0500 Subject: [PATCH] Fix Addie creating threads in DMs instead of flat replies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When streaming responses in Assistant threads, we were always passing thread_ts (falling back to event.ts for new threads), which caused Slack to create a nested thread on the user's message. Now we only pass thread_ts when continuing an existing thread. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .changeset/great-cobras-wave.md | 2 ++ server/src/addie/bolt-app.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/great-cobras-wave.md diff --git a/.changeset/great-cobras-wave.md b/.changeset/great-cobras-wave.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/great-cobras-wave.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/server/src/addie/bolt-app.ts b/server/src/addie/bolt-app.ts index deaa91834f..538f73e2b2 100644 --- a/server/src/addie/bolt-app.ts +++ b/server/src/addie/bolt-app.ts @@ -559,12 +559,16 @@ async function handleUserMessage({ logger.debug('Addie Bolt: Using streaming response'); // Initialize the stream + // Note: threadTs (line 416) falls back to event.ts for external ID tracking, + // but for the API call we only pass thread_ts when continuing an existing thread. + // This prevents creating unwanted sub-threads on new DM conversations. + const existingThreadTs = 'thread_ts' in event && event.thread_ts ? event.thread_ts : undefined; // eslint-disable-next-line @typescript-eslint/no-explicit-any const streamer = (client as any).chatStream({ channel: channelId, recipient_team_id: teamId, recipient_user_id: userId, - thread_ts: threadTs, + ...(existingThreadTs && { thread_ts: existingThreadTs }), }); // Process Claude response stream (pass conversation history for context)