openclaw - 💡(How to fix) Fix WhatsApp self-chat replies loop back as inbound after Mac-side send test [1 comments, 2 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#54349Fetched 2026-04-08 01:28:39
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1locked ×1

On WhatsApp direct self-chat (same number / self-DM), assistant replies started looping back into the inbound path after a Mac-side send test. Before that test, the chat was behaving normally.

Error Message

  • A normal user message from WhatsApp reaches the assistant correctly.
  • Assistant sends a reply.
  • That outbound reply is then received by the assistant again as if it were a new inbound user message from the same chat.
  • Restarting the gateway does not clear the loop.

Root Cause

This makes the self-chat effectively unusable for testing because assistant messages are echoed back as new user inputs.

RAW_BUFFERClick to expand / collapse

Summary

On WhatsApp direct self-chat (same number / self-DM), assistant replies started looping back into the inbound path after a Mac-side send test. Before that test, the chat was behaving normally.

Observed behavior

  • A normal user message from WhatsApp reaches the assistant correctly.
  • Assistant sends a reply.
  • That outbound reply is then received by the assistant again as if it were a new inbound user message from the same chat.
  • Restarting the gateway does not clear the loop.

Context

Environment from runtime/session:

  • Surface/provider: WhatsApp
  • Chat type: direct
  • Host: macOS (MacBook Air)
  • OpenClaw runtime channel: whatsapp

The issue appeared after allowing a Mac-side send test. Before that, things were okay in this direct chat.

What was checked

User reported the following checks on the Mac side:

  • openclaw gateway status

    • gateway is running
    • config path is correct
    • RPC probe is OK
    • loopback/local mode
    • nothing obviously broken
  • openclaw config get gateway

    • local mode
    • loopback bind
    • token auth
    • nothing obviously wrong
  • openclaw config get messaging

    • key does not exist on this version

Gateway restart was attempted and did not fix the loop.

Likely scope

This does not look like a simple top-level gateway health/config issue.

It seems more like one of:

  • WhatsApp self-chat / same-number edge case
  • provider routing bug where outbound messages are re-consumed as inbound
  • reply/session routing confusion triggered by the Mac-side send path

Reproduction sketch

  1. Use OpenClaw on WhatsApp in a direct self-chat / same-number chat.
  2. Confirm inbound user messages are handled normally.
  3. Trigger a send from the Mac side / host-side path.
  4. Subsequent assistant replies in that chat may get reflected back into the same inbound path.
  5. Restart gateway.
  6. Loop still persists.

Impact

This makes the self-chat effectively unusable for testing because assistant messages are echoed back as new user inputs.

Notes

A group chat or a different recipient may avoid the issue, so this may be specific to self-DM semantics on WhatsApp.

extent analysis

Fix Plan

To fix the looping issue in WhatsApp direct self-chat, we need to modify the message routing logic to handle self-chats differently. Here are the steps:

  • Update the openclaw configuration to include a new setting for self-chat handling:
    • Add a self_chat_mode setting to the messaging configuration section.
    • Set self_chat_mode to ignore_outbound to ignore outbound messages in self-chats.
  • Modify the message routing logic to check for self-chats and ignore outbound messages:
    • Update the handle_inbound_message function to check if the message is from a self-chat.
    • If it is, ignore the message if it's an outbound reply.

Example code snippet:

# messaging_config.py
messaging_config = {
    # ... existing config ...
    'self_chat_mode': 'ignore_outbound'
}

# message_router.py
def handle_inbound_message(message):
    if message['chat_type'] == 'self' and message['direction'] == 'outbound':
        if messaging_config['self_chat_mode'] == 'ignore_outbound':
            # Ignore outbound messages in self-chats
            return
    # ... existing logic ...

Verification

To verify the fix, follow these steps:

  • Restart the gateway.
  • Test the self-chat again by sending a message from the Mac side.
  • Verify that the assistant replies are no longer echoed back as new user inputs.

Extra Tips

  • Make sure to update the openclaw configuration and restart the gateway after making changes.
  • If the issue persists, try setting self_chat_mode to debug to enable additional logging and debugging information.

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 - 💡(How to fix) Fix WhatsApp self-chat replies loop back as inbound after Mac-side send test [1 comments, 2 participants]