Skip to content

[Bug]: Slack thread sessions don't load prior thread messages (including thread parent) #12742

@jamshehan

Description

@jamshehan

[Bug]: Slack thread sessions don't load prior thread messages (including thread parent)

Summary

When a new Slack thread session is created (via replyToMode: "all"), the thread session starts with zero context - it doesn't load any prior messages from the thread, including the thread parent message that started the conversation.

This causes the agent to lose all context mid-conversation when transitioning from channel → thread.

Steps to reproduce

  1. Configure Slack with replyToMode: "all" (or similar threading config)
  2. In a Slack channel, ask the agent a question (agent responds in channel)
  3. Agent's response automatically creates a thread (as expected)
  4. Reply to that thread with a follow-up question
  5. Observe that the agent has no memory of the conversation - not even its own message that started the thread

Expected behavior

Thread sessions should load all prior thread messages when initialized, including:

  • The thread parent message (agent's original response)
  • All subsequent messages in the thread

This ensures conversation continuity when OpenClaw creates a new thread session.

Actual behavior

Thread sessions start with empty context. The session key changes from:

  • agent:main:slack:channel:<channelId> (main channel)
  • agent:main:slack:channel:<channelId>:thread:<threadTs> (thread session)

But the thread session doesn't load any prior thread messages, even though they exist in Slack.

Example conversation flow:

  1. Channel message (me): "Check if this task has been completed: Mobile sidebar"
  2. Channel response (agent): "Looking at the Mission Control task list, I can see that task is still in backlog status..." ← thread parent
  3. Thread reply (me): "Check the code and see if it was implemented. If not, start on it."
  4. Thread response (agent): "I need more context about what you're asking me to check..." ← forgot everything, including its own message

The agent literally forgot its own message (#2) that started the thread.

Environment

  • OpenClaw version: 2026.2.3-1
  • OS: Windows 11 (10.0.26100)
  • Install method: npm global
  • Slack config:
    {
      channels: {
        slack: {
          mode: "socket",
          groupPolicy: "open",
          replyToMode: "all"
        }
      }
    }

Additional context

This might be related to issue #758 (thread context inheritance issues), but that issue focuses on threads inheriting context from OTHER sessions. This issue is simpler: threads don't even load their OWN prior messages.

The root cause appears to be that when OpenClaw creates a new thread session, it doesn't fetch the thread history from Slack before initializing the session transcript.

Possible fix

When initializing a thread session for the first time:

  1. Check if thread_ts exists in the routing context
  2. If yes, fetch thread history from Slack API (conversations.replies with ts=thread_ts)
  3. Load those messages into the new session transcript before processing the current message

This would ensure thread sessions start with complete context rather than a blank slate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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