Repository navigation
fix(matrix): forward-port 2026.10.10 startup and shutdown fixes - #192385
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 delays Matrix readiness until startup completes, releases request timers, contains late verification failures, and updates related QA scenarios. Example: A Matrix CLI command completes a request with a 110000 ms deadline and stops its client.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-authored PR open: current main still needs these Matrix lifecycle fixes, and review found no actionable correctness defects. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Matrix plugin owns account startup and status, while its patched Matrix SDK handles homeserver requests and encrypted verification events. flowchart TD
A[Gateway or Matrix CLI] --> B[Matrix account client]
B --> C[Matrix SDK]
C --> D[Matrix homeserver]
B --> E[Startup maintenance]
E --> F[Monitor readiness]
C --> G[Request and verification cleanup]
Technical reviewBest possible solution: Retain the focused fixes in the existing Matrix owners and land after dependency-patch approval and resolution of the CI gate. Do we have a high-confidence way to reproduce the issue? Current-main readiness ordering and the pinned SDK source establish the failing paths; no target code was executed during this read-only review. Is this the best way to solve the issue? The change repairs readiness in its existing controller and detached failure handling in the SDK, while aligning QA with established ownership contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 57c207777674. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +73, Tests +162, Other +72. Total +307 across 13 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (1 earlier review cycle)
Reviewed November 4, 2026, 5:11 PM ET / 22:11 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep account readiness in startup until Matrix startup maintenance and crypto ownership initialization have settled, preventing hard-restart consumers from interrupting final state handoff. The monitor is the status controller's only consumer, so deferral is unconditional rather than an option. Forward-port of 5fe32d9 from release/2026.10.10.
matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10.
…shing matrix-js-sdk starts in-room verification processing without awaiting it, including after an encrypted verification event finishes decrypting. Once the client has stopped, OpenClaw's retired crypto IndexedDB generation rejects receiveVerificationEvent, and the rejection reaches the process unhandled-rejection guard, which begins process exit. In the QA Matrix lane the exit gate stopped the CLI scheduler mid-run, so every later isolated scenario failed with "Failed to stage the isolated QA auth profile store". matrix-js-sdk 43.0.0 still leaves this path unguarded. Catch and log the failure inside the SDK's fire-and-forget verification path. Forward-port of 2a6a3bc from release/2026.10.10.
Two Matrix QA scenarios asserted behavior the product intentionally retired; earlier lane failures masked them. - matrix-e2ee-cli-setup-then-gateway-reply ran `openclaw matrix encryption setup` while the Gateway owned the state root. Since #168471 only verify status/bootstrap/device route through a running Gateway; other Matrix commands refuse until it is stopped (docs/channels/matrix.md). Run setup in the stop/run/restart window, then keep the Gateway reply proof. - matrix-e2ee-corrupt-crypto-idb-snapshot expected backup restore to repair a corrupted crypto snapshot. Since #160707 crypto ownership refuses unsafe or corrupt snapshots and points at `openclaw matrix doctor inspect` (docs/channels/matrix/encryption.md). Assert that refusal and that the corrupted snapshot is left in place. The refusal assertion and the backup-bootstrap classifier move to the destructive-recovery sibling to keep the scenario module under its line cap. Forward-port of 0f4dc59 from release/2026.10.10.
31a8cba to
ef3258e
Compare
Carry the final reviewed changes from #191830, #192378, #192379, #192380, #192383, #192385, and #192386. Preserve #191838's existing file-transfer import fix. Adapt Gateway readiness to the release owner and include the narrow SQLite cold-admission prerequisite from #192586. Do not carry #192387: its Goal expectation depends on main-only Stop-to-paused behavior absent from this release. Retain regression allocations without changing the shared baseline.
…claw#192385) * fix(matrix): defer ready status through startup Keep account readiness in startup until Matrix startup maintenance and crypto ownership initialization have settled, preventing hard-restart consumers from interrupting final state handoff. The monitor is the status controller's only consumer, so deferral is unconditional rather than an option. Forward-port of 5fe32d9 from release/2026.10.10. * fix(matrix): let Matrix CLI commands exit after their client stops matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (openclaw#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10. * fix(matrix): report late in-room verification failures instead of crashing matrix-js-sdk starts in-room verification processing without awaiting it, including after an encrypted verification event finishes decrypting. Once the client has stopped, OpenClaw's retired crypto IndexedDB generation rejects receiveVerificationEvent, and the rejection reaches the process unhandled-rejection guard, which begins process exit. In the QA Matrix lane the exit gate stopped the CLI scheduler mid-run, so every later isolated scenario failed with "Failed to stage the isolated QA auth profile store". matrix-js-sdk 43.0.0 still leaves this path unguarded. Catch and log the failure inside the SDK's fire-and-forget verification path. Forward-port of 2a6a3bc from release/2026.10.10. * test(qa): align Matrix E2EE scenarios with offline ownership contracts Two Matrix QA scenarios asserted behavior the product intentionally retired; earlier lane failures masked them. - matrix-e2ee-cli-setup-then-gateway-reply ran `openclaw matrix encryption setup` while the Gateway owned the state root. Since openclaw#168471 only verify status/bootstrap/device route through a running Gateway; other Matrix commands refuse until it is stopped (docs/channels/matrix.md). Run setup in the stop/run/restart window, then keep the Gateway reply proof. - matrix-e2ee-corrupt-crypto-idb-snapshot expected backup restore to repair a corrupted crypto snapshot. Since openclaw#160707 crypto ownership refuses unsafe or corrupt snapshots and points at `openclaw matrix doctor inspect` (docs/channels/matrix/encryption.md). Assert that refusal and that the corrupted snapshot is left in place. The refusal assertion and the backup-bootstrap classifier move to the destructive-recovery sibling to keep the scenario module under its line cap. Forward-port of 0f4dc59 from release/2026.10.10. * test(matrix): scope forward-port regression allocation
Problem
Matrix fixes found during the 2026.10.10 stable release did not reach main: monitor readiness could be announced before startup maintenance completed, request deadline timers kept finished CLI commands alive, and late in-room verification failures could become unhandled rejections.
Solution
This independently mergeable slice of #191830 targets
main(not another split PR). It retains the Matrix startup/status fix, the SDK shutdown/error-handling patch, and the related E2EE QA scenarios aligned with offline state ownership and corrupt-snapshot refusal. No Codex, process, storage, scheduling, or unrelated fixes are included.Forward-ports release commits
5fe32d9c57,4bbc5971ba,2a6a3bc041, and0f4dc59109; original references and authorship are preserved in the commits. The original aggregate test-line allocation is replaced with 162 lines specific to these regressions.Evidence
git diff --check: passed.oxfmt --check: passed.oxlint --type-aware: passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-matrix.config.ts extensions/matrix/src/matrix/monitor/index.test.ts extensions/matrix/src/matrix/monitor/status.test.ts extensions/matrix/src/matrix/sdk/matrix-js-sdk-patch.sdk.test.ts: 3 files, 31 tests passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-qa.config.ts extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-e2ee-destructive.test.ts extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-e2ee-cli-recovery.test.ts extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-runtime-e2ee-cli-account.test.ts: 3 files, 25 tests passed.34007820fa2c, head31a8cba635cc: scoped-clean through P2; no accepted/actionable findings. Used the autoreview fallback because the local ClawSweeper checkout had no installed dependencies; hosted review will provide the normal additional review lane.Limitations / before landing
patches/[email protected]; explicit dependency-patch approval remains required before landing. These hunks were already shipped in 2026.10.10's SDK 42.4.0 patch, and the guarded 43.0.0 code is identical.pnpm tsgoandpnpm tsgo:extensions. These are inherited evidence, not a fresh broad typecheck of this split.Split CI status
34007820fa2c: missingMcpCatalogToolexport inmcp-metadata.tsand consequent optional UI metadata errors. That file andagent-bundle-mcp-materialize.ts/agent-bundle-mcp-types.tsare byte-identical to the base; SDK declaration preparation propagates the same error into build/boundary/lint lanes.Exact-head CI attribution audit
Audited 2026-11-04 at
31a8cba635ccba54b331fe923ed49122369fcd4c. Failed job logs were inspected individually, not inferred from their names.The MCP failures are inherited from base
34007820fa2c:src/agents/mcp-metadata.ts,agent-bundle-mcp-materialize.ts, andagent-bundle-mcp-types.tshave identical Git blob IDs at base and PR head. The missingMcpCatalogToolexport and consequent optional-property errors propagate through SDK declarations into boundary/build/lint/type lanes.The test-line ratchet is also inherited: this PR offsets its exact positive test-line delta, and its job still exceeds the adjusted ceiling by the same 47 lines already present at base (6,444,916 vs 6,444,869). No baseline increase or unrelated repair is included.
Cancelled dispatch jobs are orchestration cancellations, not passing tests or additional source defects. CI remains red; this section explains the failures rather than claiming green.
Rebase onto current main
Rebased onto
a1f99240c8367a0e012b401bed71831a3cc65026, including merged Goal-test correction #192387. New candidate:ef3258ef9031a95f381fd46897b550e2bd62d5a8. This PR still targets main independently.Verified the complete rebased tree equals the previous PR patch integrated with that main snapshot. No new behavior was added during rebase. Prior test and CI attribution sections remain evidence for their named old revisions; fresh CI on this head is pending, not claimed green.