openclaw - ✅(Solved) Fix [Bug]: Slack DM replies still misroute / mis-attribute in Control on 2026.5.2 after fix for #59001 [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77208Fetched 2026-05-05 05:51:06
View on GitHub
Comments
2
Participants
3
Timeline
11
Reactions
2
Author
Timeline (top)
mentioned ×4subscribed ×4commented ×2labeled ×1

Slack DMs still behave incorrectly on OpenClaw 2026.5.2 even after the fix that closed #59001

What I see now is a split failure:

  • inbound Slack DMs reach OpenClaw correctly
  • normal assistant replies from the Slack DM session are not delivered back to the Slack DM reliably
  • explicit/proactive sends via the message tool do reach the Slack DM
  • those direct sends appear to be attributed inconsistently in OpenClaw Control (sometimes visible under a Slack session marked as group instead of the Slack direct session)

This suggests the old DM reply bug may have regressed, or there is still a related routing / session-attribution bug affecting Slack DMs.

Related previous issue: #59001 Related fix that should already be in this release: #59030

Root Cause

Slack DMs still behave incorrectly on OpenClaw 2026.5.2 even after the fix that closed #59001

What I see now is a split failure:

  • inbound Slack DMs reach OpenClaw correctly
  • normal assistant replies from the Slack DM session are not delivered back to the Slack DM reliably
  • explicit/proactive sends via the message tool do reach the Slack DM
  • those direct sends appear to be attributed inconsistently in OpenClaw Control (sometimes visible under a Slack session marked as group instead of the Slack direct session)

This suggests the old DM reply bug may have regressed, or there is still a related routing / session-attribution bug affecting Slack DMs.

Related previous issue: #59001 Related fix that should already be in this release: #59030

PR fix notes

PR #59030: fix(slack): route live DM replies to the concrete DM channel

Description (problem / solution / changelog)

Summary

  • Problem: Slack DMs could receive pairing/system messages, but normal assistant replies were routed through the stored user:<id> target instead of the concrete inbound D... DM channel.
  • Why it matters: that split made the live reply path behave differently from the pairing/system path, so DM turns could reach final_answer without the user seeing the normal reply in Slack.
  • What changed: extensions/slack/src/monitor/message-handler/prepare.ts now uses channel:<dm-channel-id> as the live replyTarget for direct messages while keeping persisted routing metadata user-scoped; extensions/slack/src/monitor/message-handler/prepare.test.ts adds a regression test for that contract.
  • What did NOT change (scope boundary): stored session routing remains user:<id>, Slack channel/group reply behavior is unchanged, and no outbound adapter or token/auth logic was modified.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #59001
  • Related #
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

  • Root cause: the Slack monitor built ctxPayload.To as user:<slack-user-id> for DM session metadata, then reused that value as the immediate live replyTarget. That is appropriate for persisted routing, but not for the current inbound DM turn where the concrete Slack DM channel id is already known.
  • Missing detection / guardrail: there was no regression test asserting that Slack DM live replies should use the inbound D... channel while persisted routing stays user-scoped.
  • Prior context (git blame, prior PR, issue, or refactor if known): unknown.
  • Why this regressed now: unknown from local inspection. I did not trace the exact introducing commit.
  • If unknown, what was ruled out: this change does not touch Slack auth, pairing authorization, or the outbound send adapter; the issue is in the monitor prepare-stage target selection.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this: Unit test
  • Target test or file: extensions/slack/src/monitor/message-handler/prepare.test.ts
  • Scenario the test should lock in: a Slack DM turn should produce replyTarget = channel:D... while preserving ctxPayload.To = user:... and NativeChannelId = D....
  • Why this is the smallest reliable guardrail: the bug is pure Slack monitor preparation logic and does not require a live Slack session to validate the target split.
  • Existing test that already covers this (if any): none.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Slack DMs now send the live assistant reply back into the same DM channel that produced the inbound turn. Channel mentions and persisted session routing behavior are unchanged.

Diagram (if applicable)

Before:
Slack DM inbound -> ctxPayload.To = user:U123 -> live reply reuses user target -> reply can miss the active DM

After:
Slack DM inbound -> replyTarget = channel:D123 + ctxPayload.To = user:U123 -> live reply lands in the same DM -> persisted routing still works

## Changed files

- `CHANGELOG.md` (modified, +8/-0)
- `extensions/slack/src/monitor/message-handler/prepare.test.ts` (modified, +13/-0)
- `extensions/slack/src/monitor/message-handler/prepare.ts` (modified, +5/-1)

Code Example

Observed locally:
- `openclaw status` reports Slack channel OK
- direct test message sent via `message` tool was delivered successfully to the same Slack DM
- current Slack DM session metadata showed delivery context with:
  - `channel: slack`
  - `to: user:<slack-user-id>`
  - `threadId: <slack-ts>`
- old issue #59001 was closed by PR #59030 (`fix(slack): route live DM replies to the concrete DM channel`), so this may be a regression or an adjacent code path still using incorrect targeting / attribution
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Slack DMs still behave incorrectly on OpenClaw 2026.5.2 even after the fix that closed #59001

What I see now is a split failure:

  • inbound Slack DMs reach OpenClaw correctly
  • normal assistant replies from the Slack DM session are not delivered back to the Slack DM reliably
  • explicit/proactive sends via the message tool do reach the Slack DM
  • those direct sends appear to be attributed inconsistently in OpenClaw Control (sometimes visible under a Slack session marked as group instead of the Slack direct session)

This suggests the old DM reply bug may have regressed, or there is still a related routing / session-attribution bug affecting Slack DMs.

Related previous issue: #59001 Related fix that should already be in this release: #59030

Steps to reproduce

  1. Configure Slack in Socket Mode with valid app token and bot token.
  2. Enable Slack DMs.
  3. Open a direct message with the bot in Slack.
  4. Send a normal message to the bot.
  5. Observe that the inbound message reaches OpenClaw / creates or updates the Slack DM session.
  6. Let the assistant generate a normal reply.
  7. Observe that the normal reply is not visible in the Slack DM.
  8. Then send a message explicitly via the message tool to the same Slack user / DM target.
  9. Observe that this direct send does appear in Slack.
  10. In OpenClaw Control, compare where the messages appear in session history.

Expected behavior

  • Normal assistant replies from a Slack DM session should appear in the same Slack DM.
  • Outbound messages sent to that DM should be attributed to the same Slack direct session in OpenClaw Control.

Actual behavior

  • Inbound Slack DM messages are received.
  • Normal assistant replies from the DM session do not appear in Slack reliably / at all.
  • Explicit message tool sends to the same Slack user do appear in Slack.
  • In OpenClaw Control, those visible outbound messages may appear under a Slack session marked as group instead of the Slack direct session.

OpenClaw version

2026.5.2

Operating system

Ubuntu 24.04.4 LTS (Noble Numbat)

Install method

One-liner from oficical landing page (npm)

Model

gpt-5.4/openai-codex

Provider / routing chain

Slack app (Socket Mode) -> OpenClaw Gateway -> agent runtime (main session) -> Slack DM/channel delivery

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Observed locally:
- `openclaw status` reports Slack channel OK
- direct test message sent via `message` tool was delivered successfully to the same Slack DM
- current Slack DM session metadata showed delivery context with:
  - `channel: slack`
  - `to: user:<slack-user-id>`
  - `threadId: <slack-ts>`
- old issue #59001 was closed by PR #59030 (`fix(slack): route live DM replies to the concrete DM channel`), so this may be a regression or an adjacent code path still using incorrect targeting / attribution

Impact and severity

No response

Additional information

This may now be two related problems:

  1. Slack DM normal reply delivery path still failing or regressing
  2. Slack outbound message attribution in OpenClaw Control pointing at the wrong Slack session/context
<img width="1571" height="477" alt="Image" src="https://github.com/user-attachments/assets/1248d01a-7276-4f97-9dd9-c776307dbb46" />

extent analysis

TL;DR

The issue with Slack DMs not being delivered reliably in OpenClaw 2026.5.2 may be related to a regression or an adjacent code path still using incorrect targeting/attribution, and a temporary workaround could be to use the message tool for sending replies.

Guidance

  • Review the changes made in PR #59030 to ensure that the fix for routing live DM replies to the concrete DM channel is correctly implemented and not causing any regressions.
  • Investigate the session attribution logic in OpenClaw Control to determine why outbound messages are being attributed to the wrong Slack session/context.
  • Test the message tool with different scenarios to see if it consistently delivers messages to the correct Slack DM session.
  • Check the Slack app configuration and OpenClaw Gateway settings to ensure that they are correctly set up for Socket Mode and DM delivery.

Example

No code snippet is provided as the issue is more related to configuration and session attribution.

Notes

The issue may be related to a complex interaction between the Slack app, OpenClaw Gateway, and the agent runtime, and further investigation is needed to determine the root cause.

Recommendation

Apply a workaround by using the message tool for sending replies until the root cause of the issue is determined and fixed. This is because the message tool is currently delivering messages to the correct Slack DM session, whereas the normal reply delivery path is not.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • Normal assistant replies from a Slack DM session should appear in the same Slack DM.
  • Outbound messages sent to that DM should be attributed to the same Slack direct session in OpenClaw Control.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Slack DM replies still misroute / mis-attribute in Control on 2026.5.2 after fix for #59001 [1 pull requests, 2 comments, 3 participants]