openclaw - ✅(Solved) Fix Discord bot replies can trigger implicit reply-to-bot mentions [1 pull requests, 2 comments, 3 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#80234Fetched 2026-05-11 03:17:13
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Timeline (top)
commented ×2cross-referenced ×2

Root Cause

This is useful for human replies, but risky for multi-bot channels because a bot-to-bot native reply can wake another bot without an explicit <@botId> mention.

Fix Action

Fixed

PR fix notes

PR #80235: feat(discord): add implicit reply mention policy

Description (problem / solution / changelog)

Closes #80234.

Adds channels.discord.implicitReplyMentions:

{
  fromUsers: true,
  fromBots: true
}

Defaults preserve current behavior. Multi-bot deployments can set fromBots: false so bot-authored native replies do not wake another bot via the implicit reply_to_bot path; explicit <@botId> mentions still work.

Checks run:

  • pnpm exec vitest run extensions/discord/src/monitor/message-handler.preflight.test.ts --maxWorkers=1
  • pnpm config:schema:check
  • pnpm config:docs:check
  • pnpm check:bundled-channel-config-metadata
  • git diff --check

Real behavior proof

Behavior or issue addressed: Discord native reply-only mentions can wake an OpenClaw bot when another bot replies to one of its messages. This PR adds a policy knob so deployments can keep human reply activation while disabling bot-authored reply-only activation.

Real environment tested: Private Discord server with a private test channel and two OpenClaw Discord bot accounts. Server, channel, bot names, message IDs, and account IDs are intentionally omitted from this public proof.

Exact steps or command run after this patch:

  1. In the private test channel, send an anchor message from the target bot.
  2. Send a native Discord reply from a separate relay bot to that anchor message. The reply body contains no textual <@bot> mention.
  3. Observe whether the target bot wakes/responds.
  4. Repeat after applying this branch with implicitReplyMentions: { fromUsers: true, fromBots: false }.
  5. Send a separate control message from the relay bot that contains a real textual <@bot> mention and asks the target bot to reply with a known marker.

Evidence after fix: Redacted live output excerpt from the private Discord test channel:

after-fix native reply-only test:
relay bot | "oc-proof-80235-after4-231018 native-reply-no-explicit-mention" | ref=<target-bot-anchor>
UNEXPECTED_TARGET_RESPONSES=0

explicit mention control:
target bot | "oc-proof-80235-control-231107 explicit-mention-ok" | ref=<relay-bot-control-message>
EXPLICIT_CONTROL_OK=true

Observed result after fix: With fromBots:false, the bot-authored native reply-only message did not wake the target bot during the observation window. A real textual explicit mention still woke the target bot and produced the requested marker response.

What was not tested: Human-authored reply-only behavior was covered by unit tests but not repeated in the live Discord proof. PluralKit behavior was covered by unit tests but not repeated in the live Discord proof.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/.generated/config-baseline.sha256 (modified, +3/-3)
  • docs/channels/discord.md (modified, +23/-1)
  • docs/channels/groups.md (modified, +1/-0)
  • extensions/discord/src/monitor/message-handler.preflight-helpers.ts (modified, +11/-1)
  • extensions/discord/src/monitor/message-handler.preflight.test-helpers.ts (modified, +2/-0)
  • extensions/discord/src/monitor/message-handler.preflight.test.ts (modified, +189/-3)
  • extensions/discord/src/monitor/message-handler.preflight.ts (modified, +24/-4)
  • src/config/bundled-channel-config-metadata.generated.ts (modified, +16/-16)
  • src/config/types.discord.ts (modified, +7/-0)
  • src/config/zod-schema.providers-core.ts (modified, +8/-0)
RAW_BUFFERClick to expand / collapse

When Discord uses replyToMode: "first" or "all", bot-authored native replies can satisfy the requireMention gate via the existing reply_to_bot implicit mention path.

Minimal shape:

  • channels.discord.allowBots=true
  • bot A sends a native Discord reply to bot B's message
  • bot B receives a message with referencedAuthorId === botBId
  • resolveDiscordMentionState treats that as an implicit mention

This is useful for human replies, but risky for multi-bot channels because a bot-to-bot native reply can wake another bot without an explicit <@botId> mention.

Desired behavior: keep human reply UX, while allowing multi-bot deployments to require explicit mentions for bot-authored replies.

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

openclaw - ✅(Solved) Fix Discord bot replies can trigger implicit reply-to-bot mentions [1 pull requests, 2 comments, 3 participants]