refactor: centralize slack threading helpers

This commit is contained in:
Peter Steinberger
2026-01-09 16:01:47 +00:00
parent d0b06b4334
commit d099dabf37
8 changed files with 141 additions and 63 deletions
+7 -5
View File
@@ -50,7 +50,7 @@ import {
shouldSuppressMessagingToolReplies,
} from "./reply-payloads.js";
import {
createReplyToModeFilter,
createReplyToModeFilterForChannel,
resolveReplyToMode,
} from "./reply-threading.js";
import { incrementCompactionCount } from "./session-updates.js";
@@ -260,9 +260,10 @@ export async function runReplyAgent(params: {
followupRun.run.config,
replyToChannel,
);
const applyReplyToMode = createReplyToModeFilter(replyToMode, {
allowTagsWhenOff: replyToChannel === "slack",
});
const applyReplyToMode = createReplyToModeFilterForChannel(
replyToMode,
replyToChannel,
);
const cfg = followupRun.run.config;
if (shouldSteer && isStreaming) {
@@ -718,7 +719,8 @@ export async function runReplyAgent(params: {
const replyTaggedPayloads: ReplyPayload[] = applyReplyThreading({
payloads: sanitizedPayloads,
applyReplyToMode,
replyToMode,
replyToChannel,
currentMessageId: sessionCtx.MessageSid,
})
.map((payload) => {