Skip to content

[Bug]: WhatsApp group fromMe echo not filtered, causes infinite loop with implicit reply-to-bot mention detection #53386

@andrevirgantara

Description

@andrevirgantara

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When an agent sends a message to a WhatsApp group, the WhatsApp gateway does not filter the fromMe echo message, causing the agent to receive its own message with was_mentioned=true due to implicit reply-to-bot detection, triggering an infinite response loop.

Steps to reproduce

  1. Configure an agent with a WhatsApp group binding
  2. Agent sends a message to the group
  3. WhatsApp echoes the message back to the sender (normal WhatsApp behavior)
  4. Gateway processes the fromMe echo as a new inbound message
  5. Implicit reply-to-bot detection marks was_mentioned=true
  6. Agent responds to its own message, creating an infinite loop

Expected behavior

fromMe messages should be filtered out at the plugin level for group chats, or at minimum, fromMe messages should not trigger implicit mention detection.

Actual behavior

fromMe echoes are processed as regular messages with was_mentioned=true due to implicit reply-to-bot detection, causing the agent to enter an infinite loop responding to itself.

OpenClaw version

2026.3.23-2

Operating system

macOS 15.2 (Sequoia)

Install method

npm global

Model

modelstudio/qwen3.5-plus

Provider / routing chain

openclaw -> modelstudio

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: All agents bound to WhatsApp groups
Severity: High (causes infinite loop, resource waste, spam)
Frequency: Always when agent sends message to WhatsApp group
Consequence: Agent enters infinite loop, consuming API tokens and spamming the group

Additional information

Suggested fixes:

  1. Filter fromMe messages at WhatsApp plugin level before processing group messages
  2. OR add config option channels.whatsapp.groups.*.ignoreFromMe: true
  3. OR exclude fromMe messages from implicit reply-to-bot mention detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    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