Skip to content

Slack: implicitMention should check thread participation, not just parent_user_id #25760

@WaseemTheDream

Description

@WaseemTheDream

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:

  1. User @mentions bot in a channel → bot responds (creates thread)
  2. User replies in thread without @mention → bot receives it ✅ (only if bot authored the root message)
  3. 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

Environment

  • OpenClaw version: 2026.2.23
  • Channel: Slack (Socket Mode)
  • Config: requireMention: true, thread.inheritParent: true, replyToMode: all

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