fix: scope thread sessions and discord starter fetch

This commit is contained in:
Peter Steinberger
2026-01-07 19:42:50 +01:00
parent 7e5cef29a0
commit 0d021391a9
7 changed files with 84 additions and 61 deletions

View File

@@ -928,10 +928,12 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
const threadTs = message.thread_ts;
const hasThreadTs = typeof threadTs === "string" && threadTs.length > 0;
const isThreadReply =
hasThreadTs && (threadTs !== message.ts || Boolean(message.parent_user_id));
const threadSessionKey = isThreadReply && threadTs
? `slack:thread:${message.channel}:${threadTs}`
: undefined;
hasThreadTs &&
(threadTs !== message.ts || Boolean(message.parent_user_id));
const threadSessionKey =
isThreadReply && threadTs
? `${baseSessionKey}:thread:${threadTs}`
: undefined;
const parentSessionKey = isThreadReply ? baseSessionKey : undefined;
const sessionKey = threadSessionKey ?? baseSessionKey;
enqueueSystemEvent(`${inboundLabel}: ${preview}`, {