openclaw - ✅(Solved) Fix Message tool description doesn't mention read action — agent never self-recovers lost thread context [3 pull requests, 1 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#61833Fetched 2026-04-08 02:53:51
View on GitHub
Comments
0
Participants
1
Timeline
8
Reactions
0
Participants
Timeline (top)
referenced ×5cross-referenced ×3

The message tool description shown to the LLM says "Send, delete, and manage messages" with a list of supported actions, but doesn't explain what the read action does or when to use it. As a result, the agent never calls message(action="read", threadId="...") to re-read Slack thread history — even when explicitly asked to.

Root Cause

buildMessageToolDescription() generates a description like:

"Send, delete, and manage messages via channel plugins. Current channel (slack) supports: delete, edit, read, react, ..."

The action names are listed but there's no guidance on what read does, what parameters it takes, or when to use it. For send, the schema is self-evident. For read with a threadId, the agent needs to know:

  • It can fetch historical thread messages
  • It should use its current channelId and threadTs from session metadata
  • It should do this when it's missing context, not tell the user it can't access history

PR fix notes

PR #61882: fix(tools): add read action usage hint to message tool description

Description (problem / solution / changelog)

The message tool description lists supported action names but doesn't explain what read does or when to use it. Agents see read in the action list but never call message(action="read", threadId="...") to recover lost thread context — they tell users they can't access history instead.

Appends a short usage hint to the tool description when read is in the channel's supported action set, so the LLM knows it can fetch prior thread messages when it needs context.

Before: ... supports: delete, edit, read, react, send. After: ... supports: delete, edit, read, react, send. Use action="read" with threadId to fetch prior messages in a thread when you need conversation context you don't have.

Channels that don't support read are unaffected.

Fixes #61833

Changed files

  • src/agents/tools/message-tool.test.ts (modified, +42/-0)
  • src/agents/tools/message-tool.ts (modified, +5/-0)

PR #61929: fix(tools): add read action hint scoped to threadId-based channels only

Description (problem / solution / changelog)

Summary

The message tool description was adding a threadId-based hint for the read action for ALL channels, but some channels (like Feishu) use messageId for read, not threadId. This fix scopes the hint to only channels that use threadId for read (like Slack).

Changes

  1. Added channelUsesThreadIdForRead(channel) helper function that checks the channel plugin's messageActionTargetAliases to determine if the channel uses threadId or messageId for the read action.
  2. Only add the threadId hint when channelUsesThreadIdForRead returns true.
  3. Removed the hint from the generic fallback description since we don't know which channel will be used there.

Before

The hint was added for all channels supporting read, including Feishu which incorrectly requires messageId for read.

After

The hint is only added when the current channel uses threadId for read (e.g., Slack). Channels like Feishu that use messageId are unaffected.

Fixes #61833

Changed files

  • docs/cli/message.md (modified, +16/-1)
  • src/agents/tools/message-tool.ts (modified, +30/-1)

PR #61942: fix(tools): add threadId hint only for known threadId-based channels

Description (problem / solution / changelog)

Summary

The message tool description was adding a threadId-based hint for the read action for ALL channels, but some channels (like Feishu, MSTeams) use messageId for read, not threadId. This fix scopes the hint to only channels that use threadId for read.

Changes

  1. Added KNOWN_THREAD_ID_CHANNELS set for channels (Slack, Discord) that use threadId for read but don't declare it in messageActionTargetAliases.
  2. Check messageActionTargetAliases for explicit messageId (skip hint) or threadId (add hint).
  3. Conservative fallback: don't add hint for unknown channels to avoid misleading agents.

Behavior by Channel

  • Slack/Discord: Gets the hint (threadId-based, in KNOWN_THREAD_ID_CHANNELS)
  • Feishu: Does NOT get the hint (messageId-based, detected via aliases)
  • MSTeams: Does NOT get the hint (messageId-based, unknown channel defaults to false)
  • Other unknown channels: Do NOT get the hint (conservative fallback)

Why This Approach

MSTeams exposes read but its handler requires messageId (not threadId). Without the conservative fallback and explicit aliases check, MSTeams would incorrectly receive the threadId hint. The KNOWN_THREAD_ID_CHANNELS whitelist ensures Slack gets the hint it needs while MSTeams doesn't get incorrect guidance.

Fixes #61833

Changed files

  • docs/cli/message.md (modified, +16/-1)
  • src/agents/tools/message-tool.ts (modified, +40/-1)
RAW_BUFFERClick to expand / collapse

Summary

The message tool description shown to the LLM says "Send, delete, and manage messages" with a list of supported actions, but doesn't explain what the read action does or when to use it. As a result, the agent never calls message(action="read", threadId="...") to re-read Slack thread history — even when explicitly asked to.

Observed Behavior

When the agent loses thread context (due to context pruning, session reset, or long threads), it tells the user "I can't directly pull prior Slack thread history from this runtime" or says "I'll pull the thread context now" without ever calling the tool.

The read action works correctly in code — readSlackMessages() with threadId calls conversations.replies and returns thread messages. The agent just doesn't know it exists.

Root Cause

buildMessageToolDescription() generates a description like:

"Send, delete, and manage messages via channel plugins. Current channel (slack) supports: delete, edit, read, react, ..."

The action names are listed but there's no guidance on what read does, what parameters it takes, or when to use it. For send, the schema is self-evident. For read with a threadId, the agent needs to know:

  • It can fetch historical thread messages
  • It should use its current channelId and threadTs from session metadata
  • It should do this when it's missing context, not tell the user it can't access history

Suggested Fix

Add a hint to the message tool description (or the Slack plugin's messageToolHints) when read is available:

"Use read with threadId to fetch prior messages in a Slack thread when you need context you don't have."

This is the right layer for this fix — tool descriptions are where the LLM learns capabilities, not AGENTS.md.

Environment

  • OpenClaw v2026.4.2
  • Slack channel plugin, socket mode
  • Model: openai-codex/gpt-5.3-codex
  • Context pruning: cache-ttl, 1h TTL

extent analysis

TL;DR

Update the message tool description to include a hint about using the read action with threadId to fetch prior messages in a Slack thread.

Guidance

  • Review the buildMessageToolDescription() function to ensure it includes the suggested hint for the read action.
  • Verify that the hint is displayed in the message tool description when the read action is available.
  • Test the agent's behavior after updating the message tool description to confirm it calls message(action="read", threadId="...") when necessary.
  • Consider adding additional hints or documentation for other actions in the message tool description to improve the agent's understanding of available capabilities.

Example

No code snippet is provided as the issue does not require a specific code change, but rather an update to the message tool description.

Notes

The suggested fix is specific to the OpenClaw v2026.4.2 and Slack channel plugin, and may not apply to other versions or plugins. The effectiveness of the fix depends on the agent's ability to understand and utilize the updated message tool description.

Recommendation

Apply the suggested workaround by updating the message tool description to include the hint about the read action, as this is a targeted fix that addresses the specific issue described.

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…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING