[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
- Configure Slack with
replyToMode: "all" (or similar threading config)
- In a Slack channel, ask the agent a question (agent responds in channel)
- Agent's response automatically creates a thread (as expected)
- Reply to that thread with a follow-up question
- 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:
- Channel message (me): "Check if this task has been completed: Mobile sidebar"
- Channel response (agent): "Looking at the Mission Control task list, I can see that task is still in backlog status..." ← thread parent
- Thread reply (me): "Check the code and see if it was implemented. If not, start on it."
- 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:
- Check if
thread_ts exists in the routing context
- If yes, fetch thread history from Slack API (
conversations.replies with ts=thread_ts)
- 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.
[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
replyToMode: "all"(or similar threading config)Expected behavior
Thread sessions should load all prior thread messages when initialized, including:
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:
The agent literally forgot its own message (#2) that started the thread.
Environment
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:
thread_tsexists in the routing contextconversations.replieswithts=thread_ts)This would ensure thread sessions start with complete context rather than a blank slate.