refactor: unify threading contexts

This commit is contained in:
Peter Steinberger
2026-01-21 20:01:12 +00:00
parent 76600e80ba
commit 45c1ccdfcf
15 changed files with 452 additions and 481 deletions

View File

@@ -87,4 +87,21 @@ describe("buildThreadingToolContext", () => {
expect(result.currentChannelId).toBe("chat_id:7");
});
it("prefers MessageThreadId for Slack tool threading", () => {
const sessionCtx = {
Provider: "slack",
To: "channel:C1",
MessageThreadId: "123.456",
} as TemplateContext;
const result = buildThreadingToolContext({
sessionCtx,
config: { channels: { slack: { replyToMode: "all" } } } as ClawdbotConfig,
hasRepliedRef: undefined,
});
expect(result.currentChannelId).toBe("C1");
expect(result.currentThreadTs).toBe("123.456");
});
});