-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
[Bug]: WhatsApp group fromMe echo not filtered, causes infinite loop with implicit reply-to-bot mention detection #53386
Description
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
- Configure an agent with a WhatsApp group binding
- Agent sends a message to the group
- WhatsApp echoes the message back to the sender (normal WhatsApp behavior)
- Gateway processes the fromMe echo as a new inbound message
- Implicit reply-to-bot detection marks was_mentioned=true
- 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:
- Filter fromMe messages at WhatsApp plugin level before processing group messages
- OR add config option channels.whatsapp.groups.*.ignoreFromMe: true
- OR exclude fromMe messages from implicit reply-to-bot mention detection