openclaw - ✅(Solved) Fix [Bug]:iMessage channel loops assistant replies back into the same DM after upgrade to 2026.4.2 [1 pull requests, 2 comments, 3 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#60857Fetched 2026-04-08 02:46:25
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2closed ×1cross-referenced ×1

After upgrading from a 3.* release to OpenClaw 2026.4.2 on macOS Sequoia 15.1, my iMessage channel started looping assistant replies back into the same DM as new inbound messages.

This did not happen on my previous 3.* install with essentially the same config (Telegram + iMessage, DM bound to main). Telegram and webchat remain healthy; only iMessage shows this loop behavior.

Error Message

  • Fixed a separate sandbox/Docker error by starting Docker Desktop:

Root Cause

  • Verified openclaw status shows:
    • Telegram: ON, OK
    • iMessage: ON, OK, configured
  • Checked openclaw.json for any webchat, control, ui, mirror, or forward fields:
    • None present; config is essentially wizard defaults + my channels.
  • Changed session.dmScope from "main" to "per-peer" and restarted gateway:
    • Behavior changed slightly but did not eliminate the iMessage loop.
    • Reverted dmScope back to "main".
  • Confirmed Telegram and webchat work cleanly with no echo/loop.
  • Fixed a separate sandbox/Docker error by starting Docker Desktop:
    • Sandbox now works, but iMessage loop persists, so it’s not caused by Docker being down.

Fix Action

Fix / Workaround

  • Is this a known regression in the iMessage channel in 2026.4.2, especially when multiple channels share the same dmScope / main session?
  • Is there a recommended workaround (other than disabling the iMessage channel entirely) while keeping multi-channel DMs bound to main?
  • If you’d like, I can capture openclaw logs --follow focused on iMessage events and share a redacted snippet.

PR fix notes

PR #60881: fix: iMessage monitor correctly filters own outbound replies

Description (problem / solution / changelog)

Summary

After upgrading to 2026.4.2, assistant replies sent via iMessage were being read back by the iMessage monitor as new inbound messages, creating an infinite reply loop. Telegram and webchat channels were unaffected.

Root Cause

Commit b29e180ef4 (fix: prevent self-chat dedupe false positives, #55359) introduced textBackedByIdCache logic in echo-cache.ts to avoid false-positive message drops in self-chat (#47830). This logic correctly skips text fallback when an outbound GUID-backed message exists in cache but the inbound ID is a non-matching numeric SQLite row ID.

However, the skipIdShortCircuit: !hasInboundGuid flag was only passed in the isSelfChat + is_from_me=true code path. The general echo detection block for is_from_me=false messages (used for normal DM echoes) was missing this flag.

The failure sequence for a normal iMessage DM (dmPolicy: pairing, no self-chat):

  1. deliverReplies() stores sent text + GUID messageId into sentMessageCache (via remember())
  2. iMessage monitor receives the echo back with is_from_me=false and only a numeric SQLite row ID (no GUID)
  3. hasIMessageEchoMatch() iterates inbound IDs — numeric ID never matches the outbound GUID
  4. Falls through to text-only check, but hasTextOnlyMatch is false because textBackedByIdCache has a non-expired entry (the outbound message had a real GUID)
  5. skipIdShortCircuit is false (missing), so the early return fires — echo goes undetected
  6. Assistant reply is dispatched as a new user message → new agent reply → infinite loop

Changes

  • extensions/imessage/src/monitor/inbound-processing.ts: Added skipIdShortCircuit: !hasInboundGuid to the general echo detection hasIMessageEchoMatch() call (the is_from_me=false path). This mirrors the existing identical flag already used in the self-chat is_from_me=true echo check block.

Fixing openclaw/openclaw#60857

Changed files

  • extensions/imessage/src/monitor/inbound-processing.ts (modified, +7/-0)
  • src/config/io.ts (modified, +49/-3)
  • src/cron/service/timer.ts (modified, +64/-26)
  • src/cron/types.ts (modified, +4/-0)
  • src/gateway/protocol/schema/cron.ts (modified, +2/-0)

Code Example

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

---

"session": {
     "dmScope": "main"
   }

---

"channels": {
     "imessage": {
       "enabled": true,
       "cliPath": "/opt/homebrew/bin/imsg",
       "dbPath": "/Users/<user/Library/Messages/chat.db",
       "dmPolicy": "pairing",
       "allowFrom": ["+<my_phone_number"],
       "groupAllowFrom": ["open"],
       "groupPolicy": "allowlist"
     }
   }

---

"plugins": {
     "entries": {
       "imessage": { "enabled": true },
       "telegram": { "enabled": true }
     }
   }

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from a 3.* release to OpenClaw 2026.4.2 on macOS Sequoia 15.1, my iMessage channel started looping assistant replies back into the same DM as new inbound messages.

This did not happen on my previous 3.* install with essentially the same config (Telegram + iMessage, DM bound to main). Telegram and webchat remain healthy; only iMessage shows this loop behavior.

Steps to reproduce

Install OpenClaw 2026.4.2 on macOS using: Copy curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard Copy an existing .openclaw directory from an older 3.* setup over the new install to reuse config and workspace. Enable both Telegram and iMessage channels with dmPolicy: "pairing" and session.dmScope: "main": Copy "session": { "dmScope": "main" }, "channels": { "telegram": { "enabled": true, "dmPolicy": "pairing", "allowFrom": ["<telegram_user_id>"] }, "imessage": { "enabled": true, "cliPath": "/opt/homebrew/bin/imsg", "dbPath": "/Users/<user>/Library/Messages/chat.db", "dmPolicy": "pairing", "allowFrom": ["+<my_phone_number>"] } } From my iPhone, send any message via iMessage to the OpenClaw iMessage contact (paired number). Observe the assistant’s first reply (expected), then additional messages that: start with a few garbled bytes (e.g. ��, �a, ��), and contain the full text of the previous assistant reply. These echoed messages are treated as new inbound messages, causing the assistant to respond again → loop continues.

Expected behavior

iMessage DM should behave like Telegram DM: Each user message produces at most one assistant reply. Assistant replies are not re-injected as new inbound messages. No garbled prefix bytes or repeated full-response payloads appear in the iMessage thread.

Actual behavior

On 2026.4.2, with the config above: After I send a message from iMessage, the assistant replies once as expected. Then additional messages appear in the same DM that: begin with a few garbled characters; and contain the full text of the assistant’s last reply. These “echo” messages are treated as new user messages, so the assistant responds to its own previous replies, effectively creating an endless self-dialogue in my iMessage thread. Telegram and webchat channels do not show this behavior with the same dmScope and agent setup.

OpenClaw version

OpenClaw: 2026.4.2

Operating system

OS: macOS Sequoia 15.1 (arm64)

Install method

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

Model

openaiopenai-codex/gpt-5.1

Provider / routing chain

openclaw

Additional provider/model setup details

  • OS: macOS Sequoia 15.1 (arm64)
  • OpenClaw: 2026.4.2
  • Install method:
    • Previously on a 3.* version (iMessage worked fine there)
    • Uninstalled old version
    • Installed 2026.4.2 via:
      curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
    • Copied old ~/.openclaw directory over the new one to reuse config/workspace
  • Channels:
    • Telegram: enabled, works normally
    • iMessage: enabled, shows loop
  • Session config:
    "session": {
      "dmScope": "main"
    }
  • iMessage channel config:
    "channels": {
      "imessage": {
        "enabled": true,
        "cliPath": "/opt/homebrew/bin/imsg",
        "dbPath": "/Users/<user/Library/Messages/chat.db",
        "dmPolicy": "pairing",
        "allowFrom": ["+<my_phone_number"],
        "groupAllowFrom": ["open"],
        "groupPolicy": "allowlist"
      }
    }
  • Plugins:
    "plugins": {
      "entries": {
        "imessage": { "enabled": true },
        "telegram": { "enabled": true }
      }
    }
  • No webchat / control-ui / custom mirror/forward configuration present in openclaw.json.

. What I tried

  • Verified openclaw status shows:
    • Telegram: ON, OK
    • iMessage: ON, OK, configured
  • Checked openclaw.json for any webchat, control, ui, mirror, or forward fields:
    • None present; config is essentially wizard defaults + my channels.
  • Changed session.dmScope from "main" to "per-peer" and restarted gateway:
    • Behavior changed slightly but did not eliminate the iMessage loop.
    • Reverted dmScope back to "main".
  • Confirmed Telegram and webchat work cleanly with no echo/loop.
  • Fixed a separate sandbox/Docker error by starting Docker Desktop:
    • Sandbox now works, but iMessage loop persists, so it’s not caused by Docker being down.

Questions / Help wanted

  • Is this a known regression in the iMessage channel in 2026.4.2, especially when multiple channels share the same dmScope / main session?
  • Is there a recommended workaround (other than disabling the iMessage channel entirely) while keeping multi-channel DMs bound to main?
  • If you’d like, I can capture openclaw logs --follow focused on iMessage events and share a redacted snippet.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix or workaround for the iMessage loop issue in OpenClaw 2026.4.2 is to investigate and adjust the dmPolicy and dmScope settings for the iMessage channel.

Guidance

  1. Review dmPolicy and dmScope settings: Verify that the dmPolicy is set to "pairing" and dmScope is set to "main" for the iMessage channel, and consider adjusting these settings to see if it resolves the issue.
  2. Check for conflicts with other channels: Since the issue only occurs with the iMessage channel, investigate if there are any conflicts with other channels, such as Telegram, that may be causing the loop.
  3. Capture and analyze logs: Run openclaw logs --follow and capture a redacted snippet of the logs focused on iMessage events to help identify the root cause of the issue.
  4. Test with a different dmScope setting: Try setting dmScope to "per-peer" instead of "main" to see if it changes the behavior, as the user reported a slight change in behavior when trying this.
  5. Verify iMessage channel configuration: Double-check the iMessage channel configuration, including the cliPath and dbPath settings, to ensure they are correct and not causing the issue.

Example

No code snippet is provided as the issue is related to configuration and settings rather than code.

Notes

The issue may be specific to the OpenClaw 2026.4.2 version and the iMessage channel, and further investigation is needed to determine the root cause. The user has already tried some troubleshooting steps, but additional analysis of the logs and configuration settings is required.

Recommendation

Apply a workaround by adjusting the dmPolicy and dmScope settings for the iMessage channel, as this may resolve the issue without requiring a full fix. If the issue persists, consider disabling the iMessage channel or seeking further assistance from the OpenClaw support team.

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…

FAQ

Expected behavior

iMessage DM should behave like Telegram DM: Each user message produces at most one assistant reply. Assistant replies are not re-injected as new inbound messages. No garbled prefix bytes or repeated full-response payloads appear in the iMessage thread.

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 - ✅(Solved) Fix [Bug]:iMessage channel loops assistant replies back into the same DM after upgrade to 2026.4.2 [1 pull requests, 2 comments, 3 participants]