Repository navigation
fix(imessage): preserve accepted attachment delivery custody - #117238
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:39 AM ET / 05:39 UTC. ClawSweeper reviewWhat this changesThe PR makes iMessage attachment sends preserve recipient-visible original filenames and retain accepted attachment receipts when a later caption send fails. Merge readinessKeep this PR open for protected maintainer review. The patch is a coherent owner-local repair: it preserves the original attachment basename only for the native send lifetime and records accepted attachment delivery before a later caption can fail; no discrete source-level defect was found in the proposed change. Priority: P1 Review scores
Verification
How this fits togetherThe iMessage plugin converts a rendered outbound payload into native attachment and caption sends, then reports delivery facts to the shared durable message system. Those facts determine the receipt retained for retries and whether an already-visible attachment may be replayed. flowchart LR
A[Outbound payload] --> B[iMessage message adapter]
B --> C[Native attachment transport]
C --> D[Accepted delivery receipt]
D --> E[Durable delivery custody]
E --> F[Caption transport]
F --> G[Final or partial delivery result]
Decision needed
Why: The patch changes outbound message custody and retry semantics in a maintainer-labeled channel surface; source and focused integration evidence support the implementation, but the protected label requires an explicit human merge decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +93, Tests +366. Total +459 across 6 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the filename alias and accepted-delivery callback inside the iMessage owner, then land the repair after protected maintainer review confirms the custody-before-caption ordering. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main sends an attachment and then its caption without forwarding accepted attachment progress through the iMessage adapter, while the durable queue relies on that progress to retain custody. The PR adds focused durable-plugin tests for the caption-failure and custody-rejection paths; this read-only review did not execute a live iMessage send. Is this the best way to solve the issue? Yes. Recording the provider-accepted receipt at the iMessage owner before attempting the caption is the narrowest fix because that owner has the authoritative native receipt and can stop the second send if custody persistence rejects it; downstream inference would be less reliable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bcff3a0de3a9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…117238) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
iMessage's ordinary outbound owner passed UUID-bearing OpenClaw media-store paths directly to its native one-shot CLI and JSON-RPC transports. The native Swift provider copies the source basename into the recipient-visible attachment, exposing names such as
quarterly-report---UUID.pdfinstead ofquarterly-report.pdf, including threaded fallback and voice notes.The same owner accepted attachments before attempting separate captions, but did not report accepted provider facts through either real outbound adapter before the later caption send. A failed caption consequently discarded the accepted provider receipt, misrepresented visible content, and could replay an already-delivered attachment from the durable SQLite queue.
Why This Change Was Made
Refactor both native attachment transports through one private, owner-local original-filename lifecycle. Reuse the existing public SDK filename extractor and identity-safe private temporary workspace; copy the canonical stored bytes under the original basename only for the awaited native provider call, preserving the source and reliably removing the private alias on success, failure, and retry.
Publish one typed, canonical accepted-attachment result through the actual primary message adapter and attached-results adapter before attempting the caption. The result carries the original provider receipt, provider message IDs, empty visible text, visibility, and reply metadata. Durability/custody failures propagate their exact original error and prevent a second provider send. Only an actual later caption failure becomes the existing canonical partial-delivery error, retaining the accepted receipt and correctly reporting empty visible text.
User Impact
Recipients see the intended iMessage document and voice attachment filename on both native transports and threaded retries. If an attachment arrives but its caption fails, OpenClaw preserves the actual accepted provider identity and does not silently replay the attachment. If accepted-delivery custody cannot be recorded, the caption is never sent and the original persistence failure remains diagnosable.
Evidence
005287aaf182329959f0914ade85ae1a78f35874, tree0fa79906380de1664bb6ff1473fb6f30934966ce, sole parent618f3298c7dc00a41549e4dec41d8412f651624b; exactly six existing iMessage plugin/owner test files.main947886e7649ca0172f7e0f643c35f9e6283ebe5bleaves all iMessage, outbound delivery, channel lifecycle, message, and Plugin SDK owner paths unchanged; exact clean synthetic merge tree88141b928e63e0f21fad329084a7c97bc1ac25a1.main4fb19fb8c586b2d7801d1c512a4ac21e4d826505while the local checkout HEAD remained frozen at4751365ee66a0820549702c93f175fc9acc2dadc; all six final005287aaf182329959f0914ade85ae1a78f35874source blobs were individually hash-verified, and current947886e7649ca0172f7e0f643c35f9e6283ebe5bleaves every affected owner and caller unchanged. The durable integration tests use the canonicalmediaAccess.localRootsowner contract.tbx_01kyxvzs7z16rmgp37pv7yc5mm: https://github.com/openclaw/openclaw/actions/runs/30685502142. The final timing JSON reportsexitCode: 0; the lease was explicitly stopped before the final immutable commit, and direct independent status confirmedcompleted.imsgSwift commite22dfad8e54ef5ae9ef8b64a3db05f0ce25cd52c,MessageSender.swift:122-146, confirms the source basename is user-visible and provider copying completes before return. Direct inspection of installed@openclaw/fs-safeconfirms private copy permissions and guaranteed post-send cleanup.gpt-5.6-solhigh-reasoning autoreview through P0/P1/P2/P3: zero findings, confidence 0.97. Four fresh independently hostile exact-commit reviewers separately inspected both adapter seams, actual durable SQLite custody and replay, native Swift/provider copy lifetime, reply/thread/voice behavior, and dependency contracts.