openclaw - 💡(How to fix) Fix iMessage echo loop: agent's own outbound responses re-delivered as inbound messages [1 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#60045Fetched 2026-04-08 02:37:02
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

When the iMessage channel agent sends a response, the outbound message is sometimes re-delivered back to the agent as a new inbound message with was_mentioned: true. This creates a feedback loop where the agent responds to its own responses indefinitely.

Root Cause

When the iMessage channel agent sends a response, the outbound message is sometimes re-delivered back to the agent as a new inbound message with was_mentioned: true. This creates a feedback loop where the agent responds to its own responses indefinitely.

RAW_BUFFERClick to expand / collapse

Summary

When the iMessage channel agent sends a response, the outbound message is sometimes re-delivered back to the agent as a new inbound message with was_mentioned: true. This creates a feedback loop where the agent responds to its own responses indefinitely.

Environment

  • OpenClaw version: 2026.4.1 (da64a97)
  • Channel: iMessage
  • Model: Anthropic Opus 4.6
  • OS: macOS (Darwin 25.4.0 arm64)

Reproduction

  1. Send a message to the agent via iMessage
  2. If the agent's initial response is delayed (e.g. due to timeout/retry), the delayed response may be delivered back as a new inbound message
  3. Each subsequent agent response also gets echoed back, creating a loop
  4. The echoed messages have was_mentioned: true and appear as sender messages from the user's number, making them indistinguishable from real user messages

Expected Behavior

Agent outbound responses should never be re-ingested as inbound messages. The iMessage channel should either:

  • Filter outbound messages from the inbound pipeline
  • Tag outbound messages so they can be identified and dropped on re-delivery

Actual Behavior

Agent responses are delivered back as new inbound messages, triggering infinite response loops. The only way to break the loop is for the agent to recognize the echo pattern and reply NO_REPLY, which is fragile and wastes tokens.

Additional Context

This occurred after a timeout scenario where a gateway WebSocket crash (1006 abnormal closure) caused delayed message delivery. The backlog of delayed responses all arrived at once, each triggering a new response cycle.

Potentially related to the iMessage plugin reading from the Messages database without filtering out messages sent by the agent itself.

Version

OpenClaw 2026.4.1 (commit da64a97)

extent analysis

TL;DR

Filtering outbound messages from the inbound pipeline or tagging them for identification and dropping on re-delivery can prevent the feedback loop.

Guidance

  • Investigate the iMessage plugin's message reading logic to ensure it filters out messages sent by the agent itself, potentially by checking the sender's identifier or a specific tag.
  • Consider implementing a mechanism to tag outbound messages so they can be identified and dropped if re-delivered, preventing the infinite response loop.
  • Review the handling of delayed messages and timeout scenarios to prevent a backlog of responses from triggering multiple response cycles.
  • Verify that the was_mentioned: true flag is not mistakenly causing the agent to treat its own responses as new inbound messages.

Example

No specific code snippet can be provided without more details on the plugin's implementation, but a hypothetical example might involve checking the message sender before processing:

if message.sender != agent_id:
    # Process the message

Notes

The exact solution depends on the specifics of the iMessage plugin and the OpenClaw version being used. The provided information suggests a need for better filtering or tagging of outbound messages to prevent re-ingestion.

Recommendation

Apply a workaround by modifying the iMessage plugin to filter out messages sent by the agent itself, as this directly addresses the identified issue and can prevent the feedback loop without requiring a version upgrade.

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