openclaw - 💡(How to fix) Fix [Bug]: Slack async exec completion replies escape originating thread [3 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#72151Fetched 2026-04-27 05:34:07
View on GitHub
Comments
3
Participants
3
Timeline
7
Reactions
1
Timeline (top)
commented ×3cross-referenced ×2closed ×1subscribed ×1

In a Slack channel thread, an assistant reply triggered by an async exec completion event is delivered as a top-level channel message instead of staying in the originating Slack thread.

Root Cause

Severity: High for active Slack workspaces, because async/tool completion replies can escape the original thread and clutter the channel root.

Code Example

python3 - <<'PY'
   print('ROUTING_REPRO_MARKER_20260426_1408')
   PY

---

ROUTING_REPRO_MARKER_20260426_1408

---

1. Slack thread-started assistant session posts a normal reply correctly in-thread.
2. Assistant starts an async exec command from that same threaded session.
3. Async exec completes successfully and emits marker:
   ROUTING_REPRO_MARKER_20260426_1408
4. Assistant relays the completed command output.
5. Relay message appears at Slack channel root instead of as a thread reply.
6. Subsequent normal assistant replies in the same session again appear in the original thread.

---

{
  "channels": {
    "slack": {
      "replyToModeByChatType": {
        "channel": "all"
      },
      "thread": {
        "requireExplicitMention": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

In a Slack channel thread, an assistant reply triggered by an async exec completion event is delivered as a top-level channel message instead of staying in the originating Slack thread.

Steps to reproduce

  1. Start OpenClaw with Slack enabled and channels.slack.replyToModeByChatType.channel set to all.

  2. In Slack, send a message to the assistant inside an existing channel thread.

  3. In that threaded assistant turn, start an exec/tool command that completes asynchronously after the assistant turn has ended.

  4. Exact command used for the observed repro:

    python3 - <<'PY'
    print('ROUTING_REPRO_MARKER_20260426_1408')
    PY

    The command was started with a very short foreground wait so OpenClaw returned before completion and later injected the async completion event.

  5. Wait for the async completion event.

  6. Let the assistant relay the completion output back to Slack.

Expected behavior

The assistant's async completion relay should be posted in the original Slack thread that started the command.

Actual behavior

The assistant's async completion relay was posted as a top-level message in the same Slack channel, not in the original thread.

The relayed message contained this marker:

ROUTING_REPRO_MARKER_20260426_1408

Normal assistant replies before and after this async completion were delivered correctly in the original Slack thread, so the failure appears specific to async completion-event routing rather than general Slack thread delivery.

OpenClaw version

2026.4.23 (a979721)

Operating system

macOS / Darwin 25.3.0 (arm64)

Install method

Homebrew/global CLI install

Model

openai-codex/gpt-5.5

Provider / routing chain

OpenClaw -> OpenAI Codex provider

Additional provider/model setup details

No special model routing detail appears necessary for this repro. No provider credentials or account-specific details are included here.

Logs, screenshots, and evidence

Sanitized observed sequence:

1. Slack thread-started assistant session posts a normal reply correctly in-thread.
2. Assistant starts an async exec command from that same threaded session.
3. Async exec completes successfully and emits marker:
   ROUTING_REPRO_MARKER_20260426_1408
4. Assistant relays the completed command output.
5. Relay message appears at Slack channel root instead of as a thread reply.
6. Subsequent normal assistant replies in the same session again appear in the original thread.

Relevant sanitized Slack config:

{
  "channels": {
    "slack": {
      "replyToModeByChatType": {
        "channel": "all"
      },
      "thread": {
        "requireExplicitMention": true
      }
    }
  }
}

Impact and severity

Affected: Slack channel-thread users using async/tool completion flows.

Severity: High for active Slack workspaces, because async/tool completion replies can escape the original thread and clutter the channel root.

Frequency: Reproduced once with the minimal async exec marker above; similar async/background thread leaks have been observed repeatedly in real Slack use.

Consequence: Follow-up messages lose conversation context and appear in the wrong Slack location.

Additional information

This looks related to, but narrower than, #62736. The previously discussed subagent path was less clean in this environment; the async exec completion marker above is the clearest deterministic repro.

A likely area to inspect is how async completion events preserve the originating user-facing Slack route. The completion event should carry or recover an immutable route including provider/channel target/account/thread id, instead of deriving delivery from the internal async event source.

Suggested regression test:

  1. Create a synthetic Slack channel-thread session with channel reply mode all.
  2. Trigger an async exec completion event after the original assistant turn has ended.
  3. Assert the outgoing Slack payload includes the original thread id.
  4. Assert it is not sent as a top-level channel message.

extent analysis

TL;DR

The issue can be fixed by ensuring that async completion events preserve the originating Slack thread ID and use it to deliver the reply in the correct thread.

Guidance

  • Verify that the replyToModeByChatType.channel setting is correctly applied to async completion events.
  • Check how the async completion event is handled in the OpenClaw codebase, specifically how it preserves the originating Slack thread ID.
  • Inspect the Slack payload sent by OpenClaw to ensure it includes the original thread ID and is not sent as a top-level channel message.
  • Consider adding a regression test to validate the correct delivery of async completion events in Slack threads.

Example

No code snippet is provided as the issue is more related to the logic of handling async completion events and preserving thread IDs.

Notes

The issue seems to be specific to async completion events and not a general problem with Slack thread delivery. The provided channels.slack.replyToModeByChatType.channel setting and the thread.requireExplicitMention setting may be relevant to the issue.

Recommendation

Apply a workaround to ensure async completion events preserve the originating Slack thread ID, such as modifying the OpenClaw codebase to include the thread ID in the async completion event payload. This will prevent the reply from being sent as a top-level channel message and ensure it is delivered in the correct thread.

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

The assistant's async completion relay should be posted in the original Slack thread that started the command.

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 - 💡(How to fix) Fix [Bug]: Slack async exec completion replies escape originating thread [3 comments, 3 participants]