fix: coalesce GUID-linked URL previews#181
Conversation
Red/green proofExact tested head: The regression tests were added first while the implementation still required the originating text row to contain the preview URL. DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swift test --filter 'GUIDLinkedURLPreview|UnlinkedURLPreview'Before the fix: failed as expectedExit code: This reproduces the bug: a GUID-linked Apple preview whose text row omits the URL remains two history rows and two watcher events. After the fix: passedSame command and test inputs, exit code: The negative control proves an unlinked same-sender preview is still kept as a separate logical message. Broader validationDEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swift test --filter 'URLPreview|MessageWatcher|messageStats|listChats|schemaDetectsOptionalMessageColumns'
# 53 tests passed
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make test
# 428 tests passed
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make lint
# exit 0; 10 warnings; 0 serious violations
git diff --check
# exit 0The focused lane covers native Live evidence and remaining gateThe pre-fix live reproduction is recorded on the downstream PR: one Messages.app composition produced two physical rows, two A live resend against this patched imsg head has not been performed. After this fix is merged and released, the final acceptance proof remains: one composition, two structurally linked physical rows, exactly one |
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 7:13 PM ET / 23:13 UTC. Summary Reproducibility: yes. for the original duplicate-delivery bug: the supplied fixture and live Messages evidence establish two GUID-linked physical rows that should produce one logical event. The remaining concern is source-reproducible from the changed public resume contract: persist a folded event's legacy Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Retain Do we have a high-confidence way to reproduce the issue? Yes for the original duplicate-delivery bug: the supplied fixture and live Messages evidence establish two GUID-linked physical rows that should produce one logical event. The remaining concern is source-reproducible from the changed public resume contract: persist a folded event's legacy Is this the best way to solve the issue? No, not yet: GUID-based structural coalescing is the right narrow fix, but replacing the documented Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ca91c41b47e0. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (9 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Live after-fix proofTested exact head Sanitized database result: 2 physical rows in 1 chat; 1 tagged text row; 1 URL-preview balloon row containing the URL and payload; the preview row's Patched OpenClaw exact head @clawsweeper re-review |
bbbc56b to
f825c71
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
|
Maintainer verification at exact head
This is land-ready from code review and exact-head CI. I have intentionally not merged it. |
Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
|
Closing after binary maintainer review. The bug is real and the repaired head is CI-clean, but it changes the documented watch resume contract from Landing therefore requires an owner decision on legacy |
Summary
reply_to_guid, even when the text row omits the URLReproduction
On macOS 26.4.1 with imsg 0.12.3, one Messages composition containing text plus
https://example.comproduced two physical rows. The text row omitted the URL; the URL-preview balloon row contained it and referenced the text row throughreply_to_guid.imsg watchemitted two logical events, which caused two downstream OpenClaw turns.This follows up #141 and #142 and unblocks openclaw/openclaw#91243 and openclaw/openclaw#108436.
Verification
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make test: 428 tests passedDEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make lint: exit 0 with 10 existing warnings and 0 serious violationsgit diff --check: passedLive after-fix proof
Tested the exact PR head
bbbc56b5a4a38e0e9e5d5b2f06fd6bd083ae8e6bon macOS 26.4.1 with a real Messages composition containing a unique text marker plushttps://example.com. The URL preview was allowed to render before sending. Competing iMessage consumers were disabled during capture.Sanitized database evidence for the final send:
reply_to_guidlinks to text row GUIDThe patched
imsg watch --jsonemitted exactly one logical event for that composition and emitted no delayed second event after a 30-second observation window. The same result was reproduced with a second uniquely tagged composition.OpenClaw exact head
a79a39262782f78b9d399c18b0848242e32fa46dingested the coalesced event once. A successful model reply is not claimed here: the isolated downstream run first encountered an unrelated legacy workspace migration, then the disposable state lacked the routed agent's auth material. Those OpenClaw environment issues do not affect the direct after-fiximsgrow-to-event proof above.CI note
The current Linux failure is inherited from
main, where #176 added an unconditionalDarwinimport. #182 restores the Linux build and both of its CI jobs are green; rerun this PR after that base repair lands.