Skip to content

refactor(matrix): split monitor handler pipeline - #113269

Merged
steipete merged 4 commits into
mainfrom
refactor/matrix-monitor-handler-split
Jul 24, 2026
Merged

steipete merged 4 commits into
mainfrom
refactor/matrix-monitor-handler-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 createMatrixRoomMessageHandler entry 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

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix size: XL maintainer Maintainer-authored PR labels Jul 24, 2026
@steipete
steipete marked this pull request as ready for review July 24, 2026 07:52
@steipete
steipete merged commit 21f0cef into main Jul 24, 2026
188 of 191 checks passed
@steipete
steipete deleted the refactor/matrix-monitor-handler-split branch July 24, 2026 08:02
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant