Skip to content

iMessage self-chat creates echo loop despite v2026.1.22 fixes #1649

@rohan-ixlayer

Description

@rohan-ixlayer

Bug Description

Message echo loop occurs when user messages themselves via iMessage, despite fixes in v2026.1.10-1.16 (#655, #659, #1031, #1080).

Environment

  • Clawdbot version: v2026.1.22 (now updated to v2026.1.23-1)
  • OS: macOS
  • imsg CLI: Installed and configured

Configuration

"imessage": {
  "enabled": true,
  "cliPath": "imsg",
  "dmPolicy": "allowlist",
  "groupPolicy": "allowlist",
  "allowFrom": ["<user's own phone number>"]
}

Critical detail: User's own phone number is in the allowFrom list, creating a self-chat scenario.

Reproduction Steps

  1. Configure iMessage provider with user's own number in allowFrom
  2. Send a message to yourself via iMessage
  3. Clawdbot processes the message and sends a response
  4. Clawdbot echoes its own response back as a new "incoming" message
  5. Loop continues indefinitely

Expected Behavior

Deduplication logic should prevent Claude's own responses from being processed as new incoming messages, even in self-chat scenarios.

Actual Behavior

Each outbound message from Claude is echoed back as an incoming message, triggering a new API call. Loop continues until manually stopped.

Evidence

Session logs show this pattern:

[Incoming user message] → [Claude generates response] → 
[Claude's response echoed as new "incoming" message] → 
[Claude processes echoed message] → [Loop repeats]

Claude correctly responds with "NO_REPLY" to its own messages, but the echo continues to trigger new processing cycles.

Related Issues

Supposedly fixed by:

However: User was running v2026.1.22 (6+ versions after all these fixes), suggesting the self-chat edge case is not covered by existing deduplication logic.

Impact

  • Generated significant unintended API usage over ~53 minutes
  • Occurred during off-hours (user was asleep)
  • Required manual intervention to stop

Root Cause Hypothesis

The deduplication fixes likely don't handle the case where sender == recipient in the same thread. The imsg CLI may not distinguish between "sent by me" vs "received from me" when both are the same number, causing all messages in that chat to appear as incoming.

Suggested Fix

Add explicit self-chat detection:

  • Check if sender phone number matches any number in allowFrom
  • If yes, only process truly incoming messages (not echoes of outbound)
  • Consider warning users if they add their own number to allowFrom

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions