Skip to content

Slack: second thread reply routes to main channel when two messages arrive before first reply #4424

@kmgroen

Description

@kmgroen

Bug

When a user sends two messages in a Slack thread before the bot has replied to the first, the bot's reply to the second message sometimes goes to the main channel instead of staying in the thread.

Expected behavior

Both replies should stay in the thread, regardless of how many messages arrive before the bot responds.

Actual behavior

The first reply goes to the correct thread. The second reply escapes to the main channel as a top-level message.

Config

"replyToMode": "all"

Threading is set to all, so all replies should be threaded. The issue appears to be a concurrency/queueing edge case where the second queued response loses its thread_ts context during dispatch.

Steps to reproduce

  1. Open a Slack channel with Moltbot connected (replyToMode: "all")
  2. Start a thread
  3. Send two messages in quick succession (before bot replies to the first)
  4. Observe: first reply → thread ✅, second reply → main channel ❌

Environment

  • Moltbot version: 2026.1.27-beta.1
  • Channel: Slack (socket mode)
  • OS: macOS (Apple Silicon)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions