Skip to content

Add requireMention: "strict" mode to disable implicit thread mention bypass #62066

Description

@yarn-rp

Feature Request

Problem

When requireMention: true is set for a Slack channel/account, agents correctly require an explicit @mention to respond in group channels. However, once an agent replies in a Slack thread, every subsequent message in that thread bypasses the mention gate because OpenClaw treats all thread messages as "implicit reply-to-bot" mentions.

This is documented behavior (from docs/channels/groups.md):

Replying to a bot message counts as an implicit mention (when the channel supports reply metadata).

The core mention gating logic in resolveMentionGating() treats implicitMention identically to an explicit mention:

const effectiveWasMentioned = params.wasMentioned || implicit || bypass;

In multi-agent setups (e.g., 3 Slack bots in the same workspace), this causes all agents that have previously replied in a thread to respond to every new message, even when only one agent (or none) was tagged. The user loses control over which agent speaks.

Expected Behavior

When a strict mention mode is enabled, agents should only respond to messages where they are explicitly @mentioned, regardless of whether they previously participated in the thread.

Proposed Solution

Add a requireMention: "strict" mode (or a separate disableImplicitMention: true flag) that disables the implicit reply-to-bot thread mention behavior. When enabled:

  • Only explicit <@botId> app mentions pass the mention gate
  • Only configured mentionPatterns regex matches pass the mention gate
  • Replying in a thread where the bot previously responded does not count as a mention

This could be implemented at multiple levels:

  • Per-channel: channels.slack.channels."*".requireMention: "strict"
  • Per-account: channels.slack.accounts.*.requireMention: "strict"
  • Global: messages.groupChat.requireMention: "strict"

Affected Channels

This applies to all channels that support implicit reply-to-bot mentions: Slack, Telegram, WhatsApp, Discord, and Microsoft Teams.

Workaround

Currently there is no workaround. Setting requireMention: true at both channel and account levels does not prevent implicit thread mentions from bypassing the gate.

Environment

  • OpenClaw version: 2026.4.5
  • Channel: Slack (socket mode, multi-account)
  • Config: channels.slack.channels."*".requireMention: true + per-account requireMention: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions