Repository navigation
fix(matrix): restore progress updates when runtime context is unavailable - #155354
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: needs maintainer review before merge. Reviewed September 22, 2026, 8:54 AM ET / 12:54 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR restores Matrix progress sends and edits by using existing SDK configuration helpers directly, strengthens draft regression coverage, and updates the affected test fixtures. Regression provenancePossible regression — suspected (failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, focused fix absent from current main and the latest release. The earlier import finding is resolved, retained runtime evidence supports the repair, and no blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherMatrix progress drafts turn assistant and tool activity into an evolving room message. Text preparation applies the retained account’s formatting and size settings before the Matrix client sends or edits that message. flowchart TD
A[Assistant and tool activity] --> B[Progress draft]
C[Retained account settings] --> D[Text preparation]
B --> D
D --> E{Fits one event}
E -->|Yes| F[Matrix send or edit]
E -->|No| G[Normal final delivery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +71. Total +75 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep Matrix preview preparation on the existing SDK resolvers with retained account configuration and the existing send, edit, and overflow behavior. Do we have a high-confidence way to reproduce the issue? Yes: the retained-config draft callback reaches runtime lookups that throw when Matrix runtime context is unavailable, and the reporter supplies a concrete 2026.9.5 tool-turn reproduction. Current-main runtime execution was not performed in this read-only review. Is this the best way to solve the issue? Yes: calling the existing resolvers directly removes the unnecessary runtime dependency without duplicating policy or changing configuration semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f4a45a81d798. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
…trixSingleText The progress callback path calls prepareMatrixSingleText asynchronously, but getMatrixRuntime() throws 'Matrix runtime not initialized' in that context. Replace the two getMatrixRuntime().channel.text calls with the equivalent direct SDK helpers (resolveMarkdownTableMode, resolveTextChunkLimit) that accept the necessary parameters and do not require runtime context. Also add vi.mock for the SDK subpaths in the test file so the existing test mocks (resolveMarkdownTableModeMock, resolveTextChunkLimitMock) are properly applied to the new code paths. Closes openclaw#155298
…oundary guard The config-boundary contract guard blocks broad openclaw/plugin-sdk/config-runtime imports. Import resolveMarkdownTableMode from markdown-table-runtime and move the test mock to the same subpath.
c59eb2e to
39d38d3
Compare
|
The
|
|
Merged as 00aa7a6. Matrix progress drafts now use their retained configuration without requiring the plugin runtime. The runtime-unavailable send/edit regression and all ten HTTP authority cases pass; required CI and exact-head review passed. Thanks @holny for the fix and @mykhul for the Gateway before/after evidence. |
…able (openclaw#155354) Closes openclaw#155298 ## What Problem This Solves Fixes: Matrix progress and tool-activity updates disappear when an asynchronous draft callback cannot access the plugin runtime, even though the final reply still arrives. ## User Impact User impact: Matrix progress streaming can send and edit previews using its retained account settings and client. Final delivery, encryption, mention handling, and oversized-preview fallback keep their existing behavior; no configuration or migration is needed. ## Why This Change Was Made Single-event text preparation now calls the existing SDK table-mode and chunk-limit resolvers directly instead of reaching those same functions through the plugin runtime. The account, configuration, native-table setting, and Matrix event-size cap are unchanged. Multi-message chunking remains outside this repair. The existing partial-preview test now exercises the actual draft send/edit path with the runtime unavailable. Its shared client fixtures move unchanged into test support so the oversized send suite does not grow further. ## Evidence - [The reporter's normal Gateway before/after logs](openclaw#155298) show `Matrix runtime not initialized` before the two helper substitutions, then successful encrypted assistant/tool progress sends afterward on OpenClaw 2026.9.5. These are retained reporter observations, not a newly repeated live Matrix run. The SDK exports and runtime facade select the same resolver implementations. - On baseline `fbd27c6a44334575ea4afb79656264c9f56ea4a4`, the strengthened consumer regression fails at the real draft callback with `Matrix runtime not initialized`. With the repair, it sends and edits the same threaded draft with retained account limits, keeps mention-looking tool text inert, and stops an oversized preview without another event. - Focused validation: 106 send tests, 20 draft-stream tests, and the narrow SDK import guard passed (127 total; 42.36s wall). The strengthened consumer case took 17ms. Extension production/test typechecks, scoped type-aware lint, source-size/assertion ratchets, and whitespace checks passed. - The first hosted run exposed six failures in the per-wire authority fixture: it still supplied a five-character limit through the removed runtime lookup. The fixture now sets the existing Matrix chunk-limit configuration instead. All ten real HTTP authority/redirect cases pass, including revocation between chunks, with durable delivery both enabled and disabled (27.65s wall). Its test-type lane and scoped lint/format checks also pass; production code is unchanged. - No new live credentials or encrypted transport replay was used. The retained Gateway evidence establishes the reported transport outcome; the local regression covers the consumer boundary with a client fixture. Hosted test timing is not yet available for this revision. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #155298
What Problem This Solves
Fixes: Matrix progress and tool-activity updates disappear when an asynchronous draft callback cannot access the plugin runtime, even though the final reply still arrives.
User Impact
User impact: Matrix progress streaming can send and edit previews using its retained account settings and client. Final delivery, encryption, mention handling, and oversized-preview fallback keep their existing behavior; no configuration or migration is needed.
Why This Change Was Made
Single-event text preparation now calls the existing SDK table-mode and chunk-limit resolvers directly instead of reaching those same functions through the plugin runtime. The account, configuration, native-table setting, and Matrix event-size cap are unchanged. Multi-message chunking remains outside this repair.
The existing partial-preview test now exercises the actual draft send/edit path with the runtime unavailable. Its shared client fixtures move unchanged into test support so the oversized send suite does not grow further.
Evidence
Matrix runtime not initializedbefore the two helper substitutions, then successful encrypted assistant/tool progress sends afterward on OpenClaw 2026.9.5. These are retained reporter observations, not a newly repeated live Matrix run. The SDK exports and runtime facade select the same resolver implementations.80b9608a25e191a17e1466d750c2f76a38a38507, the strengthened consumer regression fails at the real draft callback withMatrix runtime not initialized. With the repair, it sends and edits the same threaded draft with retained account limits, keeps mention-looking tool text inert, and stops an oversized preview without another event.