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.
This commit is contained in:
Adam Moussa 2026-04-30 18:37:08 -04:00
parent 5a9d588ebe
commit e7b421e4cf
3 changed files with 9 additions and 2 deletions

3
.gitignore vendored
View file

@ -22,3 +22,6 @@ docs/
# Claude Code project settings
.claude/
# macOS
.DS_Store

View file

@ -173,12 +173,14 @@ export const handler = async (event: ProcessorEvent): Promise<void> => {
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;

View file

@ -36,6 +36,7 @@ async function main(): Promise<void> {
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<void> {
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,