Skip to content

watch.subscribe can report group link-preview messages as chat_id=0 DM-shaped payloads #118

@zqchris

Description

@zqchris

Summary

watch.subscribe can emit a malformed notification for an iMessage group link-preview message: the live watch payload loses the group conversation metadata and reports the event as a DM-like chat_id=0 payload, while messages.history for the same message GUID returns the correct group metadata.

This can cause downstream consumers to route replies to the sender DM unless they add their own fail-closed recovery guard.

Observed watch payload shape

For a group message containing a URL plus text, the OpenClaw monitor received an event equivalent to:

{
  "chat_id": 0,
  "chat_guid": "",
  "chat_identifier": "",
  "is_group": false,
  "sender": "<redacted account/handle>",
  "text": "https://example.invalid/...\n<message text>",
  "guid": "<redacted guid>"
}

The downstream log showed it as a direct-message route:

  • inbound: chatId=0 from=imessage:<sender>
  • outbound target became imessage:<sender>

Same GUID via history

Querying the same message GUID through messages.history returned the correct group record:

{
  "chat_id": 349,
  "chat_guid": "any;+;<redacted group>",
  "chat_identifier": "<redacted group identifier>",
  "is_group": true,
  "participants": ["<redacted>", "<redacted>"],
  "guid": "<same guid>"
}

All personal handles, message GUIDs, and group names are redacted here, but the mismatch was confirmed live on the same machine and same bridge.

Expected behavior

watch.subscribe should emit the same stable conversation metadata as messages.history for the same message GUID, especially:

  • correct positive chat_id
  • is_group: true for group chats
  • non-empty chat_guid / chat_identifier when available
  • participants/group name when available

If a live watch event cannot resolve conversation metadata, it should expose a clear error/partial flag rather than emitting a DM-shaped payload.

Downstream mitigation

OpenClaw added a local mitigation to recover malformed chat_id=0 payloads by GUID before routing, and to drop fail-closed if recovery fails:

Environment notes

  • imsg status --json reported bridge_version: 2, v2_ready: true, and watch.subscribe / messages.history in rpc_methods.
  • The triggering message was a group link-preview/link-rich message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper 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.impact:message-lossThis issue is about lost, duplicated, misrouted, or suppressed channel messages.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions