openclaw - 💡(How to fix) Fix [Bug]: iMessage file-only outbound messages bypass echo detection and trigger auto-response [5 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#59354Fetched 2026-04-08 02:25:35
View on GitHub
Comments
5
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2labeled ×2

When sending a file-only message via imsg send --to "+1..." --file "/path/to/file.pdf" --service imessage, the iMessage poller picks up the outbound message as incoming. The echo cache in the self-chat/DM handler correctly drops text-only is_from_me messages, but file-only messages have no text body to match against, so they bypass echo detection and trigger an unwanted AI auto-response (reading the PDF and replying with a summary).

Root Cause

Workaround: Set channels.imessage.includeAttachments: false in config. This prevents the poller from processing attachment-only messages. Text DMs still work normally. The root cause appears to be in monitor-provider-ClqFz1Hj.js around line 917 — the is_from_me handler drops text messages but the echo cache cannot match file-only messages (no text body to compare).

Fix Action

Fix / Workaround

Workaround: Set channels.imessage.includeAttachments: false in config. This prevents the poller from processing attachment-only messages. Text DMs still work normally. The root cause appears to be in monitor-provider-ClqFz1Hj.js around line 917 — the is_from_me handler drops text messages but the echo cache cannot match file-only messages (no text body to compare).

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When sending a file-only message via imsg send --to "+1..." --file "/path/to/file.pdf" --service imessage, the iMessage poller picks up the outbound message as incoming. The echo cache in the self-chat/DM handler correctly drops text-only is_from_me messages, but file-only messages have no text body to match against, so they bypass echo detection and trigger an unwanted AI auto-response (reading the PDF and replying with a summary).

Steps to reproduce

  1. Configure iMessage with includeAttachments: true and dmPolicy: pairing
  2. Have an active iMessage DM chat with an allowed contact
  3. From the agent session, run: imsg send --to "+1XXXXXXXXXX" --file "/path/to/file.pdf" --service imessage
  4. Observe: the iMessage poller picks up the outbound file as an incoming message
  5. A new session is created and the AI responds to its own file delivery with a PDF summary

Expected behavior

Outbound file-only messages sent via imsg send should be dropped by echo detection, same as outbound text-only messages. The is_from_me check in monitor-provider (~line 917) should handle file-only messages.

Actual behavior

The outbound PDF triggers a new inbound session. The AI reads the PDF attachment and sends back a multi-paragraph summary/analysis as a reply in the same iMessage chat. This creates a loop of unwanted responses after every file delivery.

OpenClaw version

2026.3.28 (also reproduced on 2026.4.1)

Operating system

macOS 15.4 (Apple Silicon M4)

Install method

npm global

Model

anthropic/claude-opus-4-6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: All iMessage users who send files via imsg send CLI with includeAttachments: true Severity: High — sends unwanted AI-generated responses to clients/contacts after every file delivery Frequency: 100% reproducible on every file-only outbound message Consequence: Professional embarrassment — clients receive unsolicited PDF analysis after invoice/report deliveries

Additional information

Workaround: Set channels.imessage.includeAttachments: false in config. This prevents the poller from processing attachment-only messages. Text DMs still work normally. The root cause appears to be in monitor-provider-ClqFz1Hj.js around line 917 — the is_from_me handler drops text messages but the echo cache cannot match file-only messages (no text body to compare).

extent analysis

TL;DR

Update the monitor-provider to handle file-only messages by adding a check for the presence of attachments in the is_from_me handler.

Guidance

  • Review the monitor-provider-ClqFz1Hj.js file around line 917 to understand the current implementation of the is_from_me handler.
  • Modify the is_from_me handler to check for the presence of attachments in addition to the text body, to correctly identify and drop file-only messages.
  • Consider adding a log statement to verify that the updated handler is correctly identifying file-only messages.
  • Test the updated monitor-provider with the imsg send command to ensure that file-only messages are no longer triggering unwanted AI responses.

Example

// Example of updated is_from_me handler
if (message.is_from_me && (message.text || message.attachments.length > 0)) {
  // Drop the message
}

Notes

The provided workaround of setting channels.imessage.includeAttachments: false can prevent the issue, but it may not be desirable as it disables attachment processing altogether. The root cause of the issue appears to be in the monitor-provider implementation, and updating the is_from_me handler to handle file-only messages should resolve the issue.

Recommendation

Apply the workaround by setting channels.imessage.includeAttachments: false in the config until the monitor-provider can be updated to correctly handle file-only messages. This will prevent unwanted AI responses, but will also disable attachment processing.

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

Outbound file-only messages sent via imsg send should be dropped by echo detection, same as outbound text-only messages. The is_from_me check in monitor-provider (~line 917) should handle file-only messages.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING