Repository navigation
fix(matrix): retain every message ID and actual reply in multipart sends - #118128
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 2:48 PM ET / 18:48 UTC. ClawSweeper reviewWhat this changesThe PR preserves every Matrix multipart-send event ID and its actual message kind and reply relationship in final outbound delivery receipts. Merge readinessKeep this PR open for normal maintainer review. Current main still collapses multipart Matrix receipt facts to the first event’s kind/reply metadata and strips receipts at outbound return boundaries; this focused patch records those facts at the Matrix sender and preserves them through the adapter without adding a new public API or configuration surface. No discrete correctness finding was identified. Priority: P1 Review scores
Verification
How this fits togetherThe Matrix plugin turns an outbound payload into one or more Matrix events, then returns a delivery receipt to OpenClaw’s generic outbound pipeline. That receipt is used to retain the primary message ID, all emitted IDs, and per-event delivery metadata for later delivery accounting. flowchart LR
A[Outbound payload] --> B[Matrix outbound adapter]
B --> C[Matrix sender]
C --> D[One or more Matrix events]
D --> E[Authoritative event receipt]
E --> F[Aggregated outbound result]
F --> G[Generic delivery accounting]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +197. Total +217 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Merge the focused owner-boundary repair once the current-head required checks finish green, keeping Matrix event facts authoritative at send time and preserving the complete receipt through every outbound adapter return path. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence. Current main applies the first planned event’s kind and requested reply ID to all receipt parts, and the outbound adapter then removes the complete receipt from its final result; the added focused tests model a media reply followed by non-reply overflow text. Is this the best way to solve the issue? Yes. Recording event-specific facts in the Matrix sender and passing the sender’s authoritative receipt through the Matrix adapter is the narrowest maintainable fix; reconstructing kinds or replies later would reintroduce inference from incomplete state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e92a98c77d6a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer exact-head review completed at 7c8f937. Root cause: Matrix multipart receipts copied first-event kind/reply metadata onto later events and outbound wrappers dropped the complete nested receipt. The Matrix sender now records each accepted event ID, actual message kind, and native reply relation; payload/text/media adapters preserve the authoritative ordered receipt. Production +20 lines is justified by real per-event delivery facts. Hosted Blacksmith focused owner proof: 96/96 tests across three suites, including actual PNG/file loading, media overflow, chunking, voice, multiple attachments, and first-only reply fanout. Exact-head CI https://github.com/openclaw/openclaw/actions/runs/30761749660 , Workflow Sanity https://github.com/openclaw/openclaw/actions/runs/30761741029 , and Real behavior proof https://github.com/openclaw/openclaw/actions/runs/30761748723 all succeeded. Fresh independent Sol/high review found no P0/P1 issue. I personally read the full latest ClawSweeper review; its sole requested remaining step was green current-head CI plus native maintainer review, both now satisfied. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where Matrix messages containing multiple chunks, attachments, captions, or voice transcripts lost their real message IDs and recorded incorrect message types or reply relationships.
Why This Change Was Made
The Matrix sender now records each emitted event's actual type and native reply relationship. Matrix outbound adapters retain the sender's complete authoritative receipt, and multi-attachment delivery combines those receipts in real event order while preserving the existing final message ID.
User Impact
Matrix conversations correctly account for every delivered text/image/audio event. Replies apply only to messages that actually replied, the first delivered event remains the primary message, later attachments remain discoverable, and ordinary single-message behavior is unchanged.
Evidence
[image reply, text nonreply], while public results reported only the last ID and incorrectly projected both events as replying media.[media,text]kinds,[reply,null]reply facts, first primary ID, contiguous indices, and the final returned message ID.pnpm test extensions/matrix/src/matrix/send.test.ts extensions/matrix/src/outbound.test.ts extensions/matrix/src/channel.message-adapter.test.ts— 96/96 tests across three suites passed.gpt-5.6-sol/high autoreview: no actionable P0/P1 findings; confidence 0.86. TruffleHog clean.