-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Description
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
- Configure iMessage provider with user's own number in
allowFrom - Send a message to yourself via iMessage
- Clawdbot processes the message and sends a response
- Clawdbot echoes its own response back as a new "incoming" message
- 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:
- Fix reasoning in iMessage #655 (v2026.1.10): "iMessage: fix reasoning persistence; avoid partial/duplicate replies"
- Fix: avoid duplicate replies when message tool sends #659 (v2026.1.10): "Agents: avoid duplicate replies when message tool sends"
- feat: Delivery mirroring - let agents remember what they sent #1031 (v2026.1.16-2): "Messages: mirror delivered outbound text/media into session transcripts"
- fix: reduce redundant envelope formatting for iMessage and Signal #1080 (v2026.1.16-2): "Messages: avoid redundant sender envelopes for iMessage + Signal group chats"
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