Repository navigation
refactor(matrix): split monitor handler pipeline - #113269
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 24, 2026 07:52
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 25, 2026
* refactor(matrix): split monitor handler pipeline * refactor(matrix): align extracted handler types * refactor(matrix): make missing context explicit * style(matrix): order extracted handler imports
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
The Matrix inbound monitor had grown into a 2,597-line coordinator with a grandfathered max-lines suppression. Access policy, media preparation, context assembly, draft progress, and final delivery all shared one file, making transport changes harder to review safely.
Why This Change Was Made
This maintainer-requested refactor splits the existing pipeline by cohesive ownership: cached allowlist/pairing state, ingress prefix filtering, access admission, media and mention preparation, inbound context construction, draft progress state, final reply delivery, and lazy runtime loading. The public
createMatrixRoomMessageHandlerentry point and its call contract remain unchanged.The production diff grows by 658 lines because the former nested closures now have explicit typed phase contracts, imports, and a shared resolved-handler configuration. It adds no runtime branch, config, protocol, persistence path, migration, or compatibility fallback. Every resulting production module is at most 617 lines.
Matrix persistence remains SQLite-only. This change does not add or restore legacy snapshots, files, sidecars, or fallback readers.
AI-assisted: yes. The implementation was reviewed with the repository autoreview workflow.
User Impact
No user-visible behavior change. Matrix message admission, allowlists, mention handling, media fallback text, audio preflight, history ordering, draft streaming, and final delivery preserve their existing behavior while becoming independently reviewable.
Evidence
node scripts/run-vitest.mjs.node scripts/check-changed.mjs -- <touched files>passed extension production/test typechecks, formatting, extension lint, max-lines ratchet, plugin boundaries, database-first storage guard, and zero runtime import cycles. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30075796140corepack pnpm deadcode:exportspassed production, full-tree, and script unused-export scans with 0 entries. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30076156263$HOME/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, no accepted/actionable findings.