Skip to content

[Slack] Top-level messages with thread_ts == ts incorrectly generate 🧵 session keys (v2026.3.1) #32353

@spenchey

Description

@spenchey

Bug Description

Top-level Slack channel messages are being assigned a :thread: session key suffix when thread_ts == ts (i.e., the message is its own thread parent, not a reply). This causes every new top-level message in the channel to create a fresh isolated session, resulting in complete context loss between messages.

Environment

  • Version: v2026.3.1
  • Channel: Slack
  • Config: replyToMode: "off", thread.historyScope: "channel", thread.inheritParent: true

Steps to Reproduce

  1. Send a top-level message to a Slack channel (not a thread reply)
  2. Observe the session key generated for that message

Expected Behavior

Session key should be: agent:main:slack:channel:c0ac4m19zdl

Actual Behavior

Session key is: agent:main:slack:channel:c0ac4m19zdl:thread:1772498423.706199

The thread_ts (1772498423.706199) equals the message's own ts (1772498423.706199), which per Slack's API spec means the message is a top-level channel message — not a thread reply. OpenClaw is incorrectly treating these as threaded messages.

Impact

  • Every top-level channel message creates an isolated session
  • Complete context loss between messages in the same channel
  • Bot cannot maintain conversation continuity in Slack channels

Suggested Fix

When determining session key for Slack messages, check if thread_ts == ts. If true, the message is a top-level post and should use the channel-scoped session key (without the :thread: suffix), not a thread-scoped key.

if (message.thread_ts && message.thread_ts !== message.ts) {
  // actual thread reply → use thread-scoped session
} else {
  // top-level message → use channel-scoped session
}

Workaround

Set historyLimit: 200 as a bandaid to provide more context within each isolated session, but this does not address the root cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions