AgentFixboard

iMessage self-chat treats the agent's own reply as a new user message

In an iMessage self-chat, the agent's own replies come back as new inbound user messages. The is_from_me=1 copy is never matched against the echo cache.

From GitHub

openclaw/openclaw

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
—
Last checked

Not fixed upstream yet: the issue is open. Source: issue open. Last checked 2026-10-23.

Symptom

In an iMessage self-chat, the agent's own replies come back as new inbound user messages. The is_from_me=1 copy is never matched against the echo cache.

Evidence what you'll see

  • Outbound replies are filed under scope <account>:chat_id:<n>. The inbound check only adds that chat_id scope for groups, so hasIMessageEchoMatch misses the reply.
  • A send that uses a handle logs dropped inbound message ... reason="agent echo in self-chat". Agent replies never produce that line. Only the reflected is_from_me=0 copy is dropped as self-chat echo.
  • A gateway send with to: "chat_id:<n>" reproduces it without an agent run.

Why it happens

For a direct chat with a known chat_id, replyTarget is chat_id:<n>, and both send and the persisted echo store use <account>:chat_id:<n>. buildIMessageEchoScope (inlined as echoScope in 2026.10.6) gives direct chats <account>:imessage:<sender>, chat_guid, and chat_identifier, but never chat_id. skipSelfChatHasCheck = true then dispatches the unmatched own-send row.

Affected versions

@openclaw/imessage 2026.9.6. The same inbound echo-scope code is in OpenClaw 2026.10.6.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • A chat_id-targeted send in the self-chat is dropped as reason="agent echo in self-chat", and the agent's reply does not start a new user turn.

If it still fails

  • Sends that use a handle (openclaw message send --target +1... or gateway send with to: "+1...") already match and are dropped. The miss is the chat_id scope used for agent replies.
  • The linked issue does not name a release that adds the direct-chat chat_id scope.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it