From e7b421e4cf74d8f5dc053d230dca06601bb13f06 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Thu, 30 Apr 2026 18:37:08 -0400 Subject: [PATCH] fix: flat DM replies, clean up debug logging DMs now reply flat in conversation instead of threading. Channel @mentions still thread. Removed verbose debug logging from socket-mode service, kept minimal operational logs. Added .DS_Store to gitignore. --- .gitignore | 3 +++ lambda/slack-processor/index.ts | 6 ++++-- services/socket-mode/src/index.ts | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fed1a61..5366b57 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ docs/ # Claude Code project settings .claude/ + +# macOS +.DS_Store diff --git a/lambda/slack-processor/index.ts b/lambda/slack-processor/index.ts index 519efc3..e578b18 100644 --- a/lambda/slack-processor/index.ts +++ b/lambda/slack-processor/index.ts @@ -173,12 +173,14 @@ export const handler = async (event: ProcessorEvent): Promise => { resolveSessionId(userId), ]); - // Post placeholder immediately so the user sees a response while the agent thinks + // In channels, reply in a thread; in DMs, reply flat (no thread_ts) + const replyThreadTs = eventType === 'app_mention' ? (threadTs ?? ts) : threadTs; + const placeholderTs = await postToSlack( credentials.botToken, channelId, '_Alex is thinking..._', - threadTs ?? ts, + replyThreadTs, ); let answer: string; diff --git a/services/socket-mode/src/index.ts b/services/socket-mode/src/index.ts index 59e3265..bbb7fc4 100644 --- a/services/socket-mode/src/index.ts +++ b/services/socket-mode/src/index.ts @@ -36,6 +36,7 @@ async function main(): Promise { if (event.bot_id || event.subtype) return; if (event.channel_type !== 'im') return; + console.log('Processing DM from', event.user); await invokeProcessor({ userId: event.user, channelId: event.channel, @@ -51,6 +52,7 @@ async function main(): Promise { const text = (event.text ?? '').replace(/^<@[A-Z0-9]+>\s*/, ''); + console.log('Processing @mention from', event.user, 'in', event.channel); await invokeProcessor({ userId: event.user, channelId: event.channel,