Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR saves private Matrix crypto state before uploading public keys and rejects publication when that save fails. Example: An encrypted Matrix device uploads 50 signed one-time keys, then the process is interrupted.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: current main still lacks the key-publication durability barrier, and this PR contains useful, bounded work with no verified introduced defect. Priority: P1 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Matrix plugin connects SDK-generated key-upload requests to guarded HTTP transport and account-scoped SQLite snapshots of the Rust crypto store. flowchart TD
A[Matrix Rust crypto] --> B[SDK key upload]
B --> C[Guarded fetch]
C --> D[Live authority checks]
D --> E[Account snapshot]
E --> F[SQLite write admission]
F --> G[Homeserver publication]
Technical reviewBest possible solution: Accept the bounded durability barrier with an explicit owner decision on storage-failure rejection, while retaining separate session-crash work. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the ordering gap, and the linked report plus recorded runtime observations support it; this read-only review ran no target code. Is this the best way to solve the issue? The pre-publication boundary is the correct place to prevent recurrence, and forwarding authority into the existing SQLite owner avoids a competing persistence mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3260cae2b3c6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +141, Tests +207. Total +348 across 7 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (22 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 12:08 PM ET / 16:08 UTC (Revision 23). |
|
@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:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
2ea2e85 to
6a8916e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fixed the current-head Verified at
The existing runtime trace was not rerun; this commit is a structure-only extraction of the already-proven guard. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed the remaining current-head Verified at
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Finished the extracted Matrix recovery test helpers and published f9d8c8fd297 on the exact contributor branch. Verification on this head:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Squash of open upstream PR openclaw#147457 (head f9d8c8fd29) onto origin/main for integrate/live. Upstream-PR: openclaw#147457
|
Live-lab data for this PR, in case it helps the review. To be clear about scope up front: this is not the authority-chain proof the latest review asks for (stopped or reassigned client rejected before the snapshot write). It is a real-homeserver before/after for the crash paths in #165636 and #158784. What was tested. Head Lab. OpenClaw 2026.10.1 from npm in an isolated state dir, local tuwunel 1.9.3 homeserver, production SQLite sync store, scripted matrix-js-sdk peer with Rust crypto, fresh bot account and empty crypto store per run,
Reading.
On the authority finding (code reading against current main, not exercised live):
Not tested: the exact head commit, the PR's unit tests, storage-failure behaviour, Synapse, key backup. written by an AI agent (kumo) on behalf of @nissl24 |
|
Thanks for the carefully scoped lab results. They support the first-contact durability benefit on your ported 2026.10.1 build, not exact-head verification or a fix for later received-session/outbound-state persistence. I will keep those limits explicit rather than extend this PR to the adjacent crash paths. Your authority analysis matches the current source: the guarded fetch already drains recovery-key persistence, while this PR places the snapshot before that guard. Moving the fence into The separate Matrix-maintainer decision on fail-closed key publication during storage failure remains unchanged. |
f9d8c8f to
7f756b7
Compare
|
Current-head runtime evidence for I exercised the production Matrix client and guarded fetch with installed matrix-js-sdk 42.4.0, real Rust crypto WASM, the real SQLite worker owner, and an ephemeral loopback HTTP server. No SDK or transport mock was used. Initial publication used the SDK outgoing processor's actual Rust-generated signed device/one-time-key request. Observed at the loopback server and canonical store:
The proof passed in the broker-capable process-fork lane: 602 ms scenario time, 8.36 s total wrapper time. The held-write/storage-refusal scheduling seams delegate successful writes to the actual state owner. Failure/recovery/retirement/restart explicitly replay the Rust-generated signed payload through SDK Limits remain explicit: the server is a fixed loopback protocol fixture, not a real Matrix homeserver, and the earlier current-head restart alone was not a v2026.10.1 upgrade. Existing Matrix-maintainer acceptance of fail-closed publication also remains outstanding; this evidence neither resolves that decision nor expands the fix to received-session/outbound-ratchet crash paths. Published v2026.10.1 upgrade evidence (2026-10-11 UTC)In a separate disposable fixture I used the integrity-verified published Teardown limitation: the stable seed emitted its successful persistence receipt but did not exit within its 60-second bound; the wrapper terminated it, and its absence was verified before the candidate opened the state. This is not a claim of a fully passing stable-process lifecycle run. The continuity proof covers device identity and private one-time-key state, not received Megolm sessions or outbound ratchets. This remains a loopback protocol fixture, not real-homeserver verification. The existing Matrix-maintainer policy decision remains outstanding. |
Persist the private crypto-state snapshot before publishing room keys so a crash or storage failure cannot leave uploaded keys without recoverable local state. Key uploads fail closed when the snapshot cannot be stored.
Closes #147450
Related: #123354 (separate received/outbound session crash paths remain outside this PR).
What Problem This Solves
Matrix can publish one-time keys before the matching private crypto account is durable, leaving unusable keys or conflicting upload IDs after an interruption. Save the account-scoped snapshot before publication and reject the upload if that save fails. This prevents recurrence; it does not repair an already inconsistent server key pool or reset device identity.
User Impact
Private account state must be saved before its public keys are published. Storage failures block publication until account-scoped storage is repaired and the upload is retried. Matrix-maintainer acceptance of that fail-closed tradeoff remains outstanding.
Why This Change Was Made
The barrier runs inside the existing guarded fetch beforeRequest hook, after recovery-key persistence and message-dispatch checks. It carries originating generation, caller authority and cancellation through awaited persistence into existing SQLite action-authority admission. Ordinary requests do not load the crypto runtime. Current-main session/lifecycle owners are preserved; no snapshot-format, dependency or scope change is introduced.
Evidence
Tested candidate:
2592b4812a4db60e8bf5a44b44f7961331724be9(2026-10-16 UTC), compared with pinned base0dc31f5f64309d199f12aea643452bfde54f4888. Conflict-only rebase preserves the upload barrier and originating write authority while adopting upstream's void snapshot-lock callback.ui/src/pages/chat/components/chat-message.test.tsx,ui/src/pages/config/config-page-state.tsandui/src/pages/sessions/sessions-page-state.tssuppressions. No baseline or suppression was changed; this check is not claimed green.7f756b78473be542b0ce1fe484dfa32ddc230262, not rerun on this candidate. The loopback fixture proved durable-before-HTTP, storage refusal/recovery, retirement rejection, restart identity, and retained stable device/one-time-key state. Its stable-process teardown timeout and non-homeserver scope remain explicit.New-head CI and automated review must be assessed separately. No merge, maintainer acceptance, current-candidate real-homeserver proof or automatic background retry behavior is claimed.