diff --git a/CHANGELOG.md b/CHANGELOG.md index b84c94e2870..e6d0c243c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,6 +106,7 @@ Docs: https://docs.openclaw.ai - Telegram/models picker callbacks: keep long model buttons selectable by falling back to compact callback payloads and resolving provider ids on selection (with provider re-prompt on ambiguity), avoiding Telegram 64-byte callback truncation failures. (#31857) Thanks @bmendonca3. - WhatsApp/inbound self-message context: propagate inbound `fromMe` through the web inbox pipeline and annotate direct self messages as `(self)` in envelopes so agents can distinguish owner-authored turns from contact turns. (#32167) Thanks @scoootscooob. - Slack/thread context payloads: only inject thread starter/history text on first thread turn for new sessions while preserving thread metadata, reducing repeated context-token bloat on long-lived thread sessions. (#32133) Thanks @sourman. +- Slack/session routing: keep top-level channel messages in one shared session when `replyToMode=off`, while preserving thread-scoped keys for true thread replies and non-off modes. (#32193) Thanks @bmendonca3. - Slack/inbound debounce routing: isolate top-level non-DM message debounce keys by message timestamp to avoid cross-thread collisions, preserve DM batching, and flush pending top-level buffers before immediate non-debounce follow-ups to keep ordering stable. (#31951) Thanks @scoootscooob. - OpenRouter/x-ai compatibility: skip `reasoning.effort` injection for `x-ai/*` models (for example Grok) so OpenRouter requests no longer fail with invalid-arguments errors on unsupported reasoning params. (#32054) Thanks @scoootscooob. - Mentions/Slack formatting hardening: add null-safe guards for runtime text normalization paths so malformed/undefined text payloads do not crash mention stripping or mrkdwn conversion. (#31865) Thanks @stone-jin. diff --git a/src/slack/monitor/message-handler/prepare.thread-session-key.test.ts b/src/slack/monitor/message-handler/prepare.thread-session-key.test.ts index 928b80f151a..46f64b42c9f 100644 --- a/src/slack/monitor/message-handler/prepare.thread-session-key.test.ts +++ b/src/slack/monitor/message-handler/prepare.thread-session-key.test.ts @@ -100,6 +100,23 @@ describe("thread-level session keys", () => { expect(sessionKey).toContain(":thread:1770408530.000000"); }); + it("keeps top-level channel turns thread-scoped when replyToMode=first", async () => { + const ctx = buildCtx({ replyToMode: "first" }); + ctx.resolveUserName = async () => ({ name: "Dora" }); + const account = createSlackTestAccount({ replyToMode: "first" }); + + const prepared = await prepareSlackMessage({ + ctx, + account, + message: buildChannelMessage({ ts: "1770408531.000000" }), + opts: { source: "message" }, + }); + + expect(prepared).toBeTruthy(); + const sessionKey = prepared!.ctxPayload.SessionKey as string; + expect(sessionKey).toContain(":thread:1770408531.000000"); + }); + it("does not add thread suffix for DMs when replyToMode=off", async () => { const ctx = buildCtx({ replyToMode: "off" }); ctx.resolveUserName = async () => ({ name: "Carol" });