Skip to content

iMessage final replies fail under SIP because outbound delivery passes reply_to even when reply actions are disabled #92142

Closed

Description

@dprev

Summary

On OpenClaw 2026.6.5, iMessage inbound messages can be received and processed successfully, but final reply delivery can fail on macOS systems with System Integrity Protection enabled. The delivery layer attempts to send the final response as a threaded/native reply by passing reply_to/replyToId to the iMessage sender. The imsg bridge then refuses because threaded/private Messages.app injection requires SIP to be disabled.

This happens even when channels.imessage.actions.reply is configured as false.

Environment

  • OpenClaw: 2026.6.5
  • Platform: macOS, LaunchAgent gateway
  • iMessage bridge: imsg 0.9.0
  • SIP: enabled
  • iMessage private API probe: unavailable, but normal send RPC methods are listed

Observed Behaviour

An iMessage group message was ingested and processed. OpenClaw created iMessage reply-cache/catchup state for the inbound message, then final delivery failed with:

imessage final reply failed: OutboundDeliveryError: System Integrity Protection (SIP) is enabled. Refusing to inject into Messages.app. Disable SIP in Recovery mode before using `imsg launch`.

The channel config had:

{
  "channels": {
    "imessage": {
      "actions": {
        "reply": false
      }
    }
  }
}

The iMessage config schema rejects channels.imessage.replyToMode, so there does not appear to be a supported config-level way to force final responses to degrade to plain top-level sends.

Expected Behaviour

If iMessage private API support is unavailable, or channels.imessage.actions.reply is false, OpenClaw should not pass reply_to/replyToId into final iMessage delivery. It should send a normal top-level iMessage instead.

Alternatively, the iMessage schema should expose a supported replyToMode: "off" option if the common channel reply-threading resolver is going to default to reply threading.

Local Hotfix Tested

A local patch in dist/send-DpmbO1o_.js changed:

const resolvedReplyToId = sanitizeReplyToId(opts.replyToId);

to:

const replyActionsEnabled = account.config.actions?.reply !== false;
const resolvedReplyToId = replyActionsEnabled ? sanitizeReplyToId(opts.replyToId) : void 0;

A no-send fake-client check confirmed that when actions.reply === false, the generated send RPC params no longer contain reply_to.

Related

There is an older closed issue about inbound iMessage reply context:

#10872

This issue is separate: outbound final response delivery attempts a SIP-gated native/threaded reply even when normal top-level iMessage delivery should be sufficient.

Related TTS Schema Gap

While testing the workaround with openclaw message send --channel imessage --target chat_id:2, a separate iMessage-specific issue appeared: global messages.tts.auto = "always" caused OpenClaw to send a generated .caf voice attachment before the text message.

This is undesirable for iMessage, and in this workspace iMessage is explicitly meant to stay text-only. However:

  • messages.tts schema in 2026.6.5 does not expose a per-channel override such as channelOverrides.imessage.auto = "off".
  • channels.imessage schema also does not expose a channel-level tts object.

Local hotfix tested:

if (params.channel === "imessage") return params.payload;

inserted at the start of maybeApplyTtsToPayload in dist/tts-runtime-B6XTTTyB.js.

A direct runtime check confirmed that an iMessage payload remains text-only even when global TTS auto mode is always.

Activity

  1. clawsweeper commented on Jun 11, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 11, 2026, 6:52 AM ET / 10:52 UTC.

    Summary
    Keep this open. Current main and v2026.6.5 still forward iMessage final-reply metadata into outbound send without honoring the existing iMessage reply action/private-API boundary, and no duplicate or merged fix was found.

    Reproducibility: yes. for source reproduction: current main forwards payload.replyToId into iMessage final delivery, and sendMessageIMessage serializes it as reply_to without checking actions.reply. I did not establish a live SIP-enabled macOS repro in this runner.

    Next step
    The affected iMessage plugin files and regression tests are narrow enough for one focused repair PR; the separate iMessage TTS override request should stay out of that fix.

    Review details

    Best possible solution:

    Strip or gate iMessage reply metadata at the plugin send/final-delivery boundary when threaded reply is disabled or unavailable, using existing action/private-API surfaces rather than adding a new config option first; handle the TTS schema note separately.

    Do we have a high-confidence way to reproduce the issue?

    Yes for source reproduction: current main forwards payload.replyToId into iMessage final delivery, and sendMessageIMessage serializes it as reply_to without checking actions.reply. I did not establish a live SIP-enabled macOS repro in this runner.

    Is this the best way to solve the issue?

    No: current main is not the best solved state because the existing iMessage action/private-API boundary is not honored by normal final delivery. The narrow maintainable fix is to strip or gate reply metadata at the iMessage delivery/send boundary, not to add a new replyToMode surface first.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • I did not run a live SIP-enabled macOS iMessage reproduction in this read-only runner; the keep-open decision rests on source-level behavior, the reporter's real log, OpenClaw docs, and imsg dependency contracts.

    Codex review notes: model internal, reasoning high; reviewed against 60e818f563d8.

    Label changes

    Label justifications:

    • P2: This is a concrete channel-specific delivery bug with limited blast radius rather than a core-wide outage.
    • impact:message-loss: The reported failure drops final iMessage replies after inbound processing succeeds.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/config-schema.test.ts
    • git diff --check

    What I checked:

    Likely related people:

    • vincentkoc: Current blame for the active send, deliver, and schema lines points to commit 4457ae3, and the v2026.6.5 release snapshot carrying the same behavior is also associated with this account. (role: recent area contributor; confidence: medium; commits: 4457ae3e3547, 5181e4f7c82b; files: extensions/imessage/src/send.ts, extensions/imessage/src/monitor/deliver.ts, src/config/zod-schema.providers-core.ts)
    • steipete: History shows this account introduced the imsg RPC adapter and later touched iMessage send/media/private-API documentation paths relevant to the boundary decision. (role: feature introducer and adjacent owner; confidence: medium; commits: cbac34347b62, 3bb02d333865, d85b2a0e8148; files: extensions/imessage/src/send.ts, docs/channels/imessage.md)
    • mvanhorn: git log -S shows prior iMessage outbound reply-tag work in send.ts, adjacent to the current reply metadata serialization behavior. (role: reply metadata contributor; confidence: medium; commits: e0972db7a292; files: extensions/imessage/src/send.ts)
    • scoootscooob: This account moved the iMessage channel into extensions/imessage, carrying the current plugin-owned delivery path shape. (role: delivery path refactor contributor; confidence: medium; commits: 0ce23dc62d37; files: extensions/imessage/src/send.ts, extensions/imessage/src/monitor/deliver.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 11, 2026
  3. added 2 commits that reference this issue on Jun 11, 2026
    2f5dbec
    1e90f51
  4. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions