-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Slack: DM session fan-out when Agent/Assistant capability is enabled #87019
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
When the Slack app has the 'Agent or Assistant' capability enabled, every DM from a user spawns a new sibling session instead of routing into the user's existing DM session. This makes DMs unusable for any agent that maintains continuous conversation context: messages land in isolated child sessions the user can't see, and the agent ends up with multiple parallel personas responding to the same DM channel.
Repro
message.im,assistant_thread_started,assistant_thread_context_changedchannels.slackinopenclaw.json(socket or http mode both reproduce)agent:<agent>:<uuid>-topic-<thread_ts>Expected
All DMs from the same user should route into the user's existing DM session, regardless of which assistant_app_thread Slack wraps them in.
Root Cause
@openclaw/[email protected], filedist/prepare-BjlcuiLr.jsaround line 464:For DM channels, the plugin always routes to
assistantThreadTsas the thread id. Slack's AI Apps feature wraps every DM in anassistant_app_threadwith a uniquethread_tsper message, so every inbound DM produces a differentroutedThreadId.That
routedThreadIdis then passed toresolveThreadSessionKeys()(inopenclawcore,dist/session-key-*.js):useSuffixdefaults totrue, and the Slack plugin doesn't passfalse. So every assistant thread = new:thread:<ts>suffix = new session.Why
replyToModeByChatType.direct: "off"doesn't fix itThat config only controls outbound reply mode (whether the bot uses thread replies vs top-level when responding). It doesn't affect inbound session-key derivation —
routedThreadIdis set independently fromreplyToMode.Proposed Fixes
Pick one of these:
(Recommended) Treat DM assistant threads as the channel-level conversation by default. Change line 464 so
isDirectMessagedoes NOT useassistantThreadTsfor session routing. Per-thread context for the AI sidebar can still be tracked separately via the existingassistantThreadContextsmap without forking the session key.Add a config flag like
channels.slack.dm.collapseAssistantThreads: true(defaulttruewould be cleanest given the current UX is broken).Pass
useSuffix: falsetoresolveThreadSessionKeyswhenisDirectMessage && !isExplicitUserReplyInThread.Environment
Workaround
Currently advising users to use webchat as the primary surface and treat Slack as outbound-only until this is fixed.
Happy to test a fix against my workspace if a PR lands.