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:
parent
5a9d588ebe
commit
e7b421e4cf
3 changed files with 9 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -22,3 +22,6 @@ docs/
|
||||||
|
|
||||||
# Claude Code project settings
|
# Claude Code project settings
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -173,12 +173,14 @@ export const handler = async (event: ProcessorEvent): Promise<void> => {
|
||||||
resolveSessionId(userId),
|
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(
|
const placeholderTs = await postToSlack(
|
||||||
credentials.botToken,
|
credentials.botToken,
|
||||||
channelId,
|
channelId,
|
||||||
'_Alex is thinking..._',
|
'_Alex is thinking..._',
|
||||||
threadTs ?? ts,
|
replyThreadTs,
|
||||||
);
|
);
|
||||||
|
|
||||||
let answer: string;
|
let answer: string;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ async function main(): Promise<void> {
|
||||||
if (event.bot_id || event.subtype) return;
|
if (event.bot_id || event.subtype) return;
|
||||||
if (event.channel_type !== 'im') return;
|
if (event.channel_type !== 'im') return;
|
||||||
|
|
||||||
|
console.log('Processing DM from', event.user);
|
||||||
await invokeProcessor({
|
await invokeProcessor({
|
||||||
userId: event.user,
|
userId: event.user,
|
||||||
channelId: event.channel,
|
channelId: event.channel,
|
||||||
|
|
@ -51,6 +52,7 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
const text = (event.text ?? '').replace(/^<@[A-Z0-9]+>\s*/, '');
|
const text = (event.text ?? '').replace(/^<@[A-Z0-9]+>\s*/, '');
|
||||||
|
|
||||||
|
console.log('Processing @mention from', event.user, 'in', event.channel);
|
||||||
await invokeProcessor({
|
await invokeProcessor({
|
||||||
userId: event.user,
|
userId: event.user,
|
||||||
channelId: event.channel,
|
channelId: event.channel,
|
||||||
|
|
|
||||||
Reference in a new issue