-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
Slack: implicitMention should check thread participation, not just parent_user_id #25760
Copy link
Copy link
Closed
Closed
Copy link
Description
Problem
The Slack implicitMention check in the message handler only triggers when the bot is the root/parent message author of a thread:
const implicitMention = Boolean(!isDirectMessage && ctx.botUserId && message.thread_ts && message.parent_user_id === ctx.botUserId);This means:
- User @mentions bot in a channel → bot responds (creates thread)
- User replies in thread without @mention → bot receives it ✅ (only if bot authored the root message)
- User starts a thread, bot gets @mentioned and replies → user follows up without @mention → bot does NOT receive it ❌
Scenario 3 is very common — the user starts a conversation, the bot joins via @mention, and then the user expects to continue naturally without re-mentioning.
Expected behavior
implicitMention should be true when the bot has any prior reply in the thread, not just when it is the parent_user_id.
Suggested fix
Check thread participation by querying whether the bot has posted in the thread (via conversations.replies or by tracking thread participation in the session store). Something like:
const implicitMention = Boolean(
!isDirectMessage && ctx.botUserId && message.thread_ts && (
message.parent_user_id === ctx.botUserId ||
await ctx.hasBotRepliedInThread(message.channel, message.thread_ts)
)
);Alternatively, a config option like thread.autoFollow: true (as suggested in #23064) that enables this behavior.
Related issues
- Slack: bot should auto-follow threads it has participated in #23064 (Slack: bot should auto-follow threads it has participated in)
- slack: keep requireMention thread follow-ups when thread session is active #21108 (slack: keep requireMention thread follow-ups when thread session is active)
Environment
- OpenClaw version: 2026.2.23
- Channel: Slack (Socket Mode)
- Config:
requireMention: true,thread.inheritParent: true,replyToMode: all
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.