Skip to content

Slack: implicit thread mention only checks parent_user_id, not thread participation #24816

@dobby1738assistant

Description

@dobby1738assistant

Slack: thread replies not detected as implicit mentions when user (not bot) starts the thread

Problem

When a user @mentions a bot in a Slack channel and the bot replies (creating a thread via replyToMode: "first"), subsequent user messages in that thread are skipped with reason: "no-mention" — even though the bot has already participated in the thread.

Root Cause

In prepareSlackMessage, the implicit mention check is:

const implicitMention = Boolean(
  !isDirectMessage && ctx.botUserId && message.thread_ts && 
  message.parent_user_id === ctx.botUserId
);

This only triggers when the bot is the thread parent (parent_user_id === botUserId). But when a user starts a thread by @mentioning a bot, parent_user_id is the user's ID, not the bot's — even though the bot has replied in the thread.

Expected Behavior

Thread replies should be treated as implicit mentions if the bot has previously participated in that thread (i.e., has posted at least one message in it), not only if the bot started the thread.

Steps to Reproduce

  1. Configure a Slack bot account with requireMention: true and replyToMode: "first" on a channel
  2. User posts @Bot let's chat in the channel
  3. Bot replies, creating a thread ✅
  4. User sends a follow-up in the thread without @mentioning the bot
  5. Message is skipped with no-mention

Suggested Fix

Replace the parent_user_id === ctx.botUserId check with a thread participation check — e.g., query the Slack conversations.replies API for the thread and check if botUserId appears in the reply authors, or track bot participation in thread sessions.

Environment

  • OpenClaw v0.42.x (Pi, arm64)
  • Slack Socket Mode, multi-account setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions