Skip to content

[Bug]: WhatsApp selfChatMode fires on all outbound DMs, not just self-chat — agent responded to third-party contacts #32632

Description

@econosopher

Summary

When selfChatMode: true is set on the WhatsApp channel, the agent incorrectly processes and responds to messages sent in any DM thread — not just the user's self-chat (note-to-self).

Config

"whatsapp": {
  "enabled": true,
  "dmPolicy": "allowlist",
  "selfChatMode": true,
  "allowFrom": ["+19194576111"],
  "actions": {
    "sendMessage": true
  }
}

What happened

The user was having a normal conversation with a friend (Dylan) in a WhatsApp DM. The agent started responding in that thread — treating the user's own outbound messages to Dylan as commands, and replying to Dylan directly as if he were the agent operator.

Root cause (analysis)

The inbound log shows the sender as +19194576111 (the user's own number) for all events — which is correct, since in WhatsApp DMs the sender field reflects who sent the message. The allowFrom allowlist matches, so the message passes through.

However, the agent cannot distinguish between:

  1. User messaging themselves (self-chat / note-to-self) → should trigger the agent
  2. User messaging a third party (e.g., a friend) → should NOT trigger the agent

The selfChatMode flag appears to enable agent triggering when the sender matches the user's own number, but it does not check whether the recipient is also the user's own number (i.e., sender == recipient == user's number).

Expected behavior

selfChatMode: true should only trigger the agent when the conversation is a true self-chat: sender and recipient are the same number (the user's own WhatsApp account number). Any DM thread where the recipient is a different number should not trigger the agent, regardless of allowFrom rules.

Workaround

Disabled sendMessage as an immediate mitigation to prevent further replies to third parties.

Environment

  • OpenClaw: 2026.3.2
  • macOS: Darwin 25.3.0 arm64
  • WhatsApp transport: personal account (not Business API)

Metadata

Metadata

Assignees

No one assigned

    Labels

    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