-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
iMessage group link-preview watch payload can lose conversation anchor and route reply to DM #84470
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
A malformed iMessage watch notification for a group link-preview message can be interpreted as a direct message, causing OpenClaw to reply to the sender DM instead of the originating group.
This is a high-risk routing/privacy bug: when a channel payload loses its conversation anchor, OpenClaw must not fall back to a sender DM.
Observed behavior
A group message containing a link arrived from
watch.subscribewith this effective shape:chat_id: 0chat_guidchat_identifieris_group: falsesenderset to the account/handle that later became the DM targetOpenClaw routed it as:
chatId=0 from=imessage:<sender>agent:<agent>:imessage:default:direct:<sender>imessage: delivered reply to imessage:<sender>The same message GUID looked up through
messages.historybelonged to the real group:chat_id: 349is_group: truechat_guid/chat_identifierI am intentionally redacting handles, GUIDs, and group names here.
Expected behavior
If iMessage watch payloads lack a valid conversation anchor, OpenClaw should either:
It should never route a malformed group/link-preview event to a sender DM.
Local mitigation proof
A local patch on
patch/chrisadds a guard and recovery path:chat_id <= 0with emptychat_guidandchat_identifierchats.list+messages.historyCommit: zqchris@7c56a6bba852
After the patch and gateway restart, the same event replayed as:
chatId=349 from=imessage:group:349agent:<agent>:imessage:group:349imessage: delivered reply to chat_id:349Verification run locally
env OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/imessage/src/monitor/conversation-repair.test.ts extensions/imessage/src/monitor.gating.test.tspnpm exec oxfmt --check --threads=1 extensions/imessage/src/monitor/conversation-repair.ts extensions/imessage/src/monitor/conversation-repair.test.ts extensions/imessage/src/monitor/monitor-provider.ts extensions/imessage/src/monitor/inbound-processing.ts extensions/imessage/src/monitor.gating.test.tsgit diff --checkpnpm buildNotes
The underlying bridge/source issue appears to be in
imsg watch.subscribe, becausemessages.historyfor the same GUID returns the correct group metadata. I am filing a companion issue againstopenclaw/imsgfor that payload mismatch.