refactor(shared): consolidate remaining channel lazy loaders#99302
Conversation
6d48fdf to
e771361
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 10:04 PM ET / 02:04 UTC. Summary PR surface: Source -283. Total -283 across 45 files. Reproducibility: not applicable. this is a maintainer refactor PR rather than a bug report; the source-shape duplication is tracked by the linked maintainer issue. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep this maintainer-labeled PR open for maintainer review and completed broad CI; the reviewed source paths do not need a ClawSweeper repair PR. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a maintainer refactor PR rather than a bug report; the source-shape duplication is tracked by the linked maintainer issue. Is this the best way to solve the issue? Yes: using the existing SDK lazy-runtime helper is the narrow canonical cleanup path, and the sampled retry/reset behaviors are preserved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3ad465d32b3b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -283. Total -283 across 45 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
e771361 to
ae5c4a7
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Related: #98748
What Problem This Solves
Matrix and the remaining channel plugins independently maintained the same lazy dynamic-import memoization pattern. Repeated promise state, loader wrappers, rejection handling, and test reset logic made startup boundaries and channel-specific semantics harder to compare and audit.
This is PR 5 of 6 in the lazy-runtime utility consolidation series.
The preceding batches established the shared loader foundation in #99261, migrated core leaf and infrastructure loaders in #99278, and cover the core gateway/stateful runtime plus Discord, Slack, and Telegram channel surfaces. After this PR, only the final provider/utility plugin migration and enforcement guard remain.
Why This Change Was Made
Migrates the authoritative 45-file Matrix and remaining-channel slice to
openclaw/plugin-sdk/lazy-runtime. The consolidation preserves Matrix crypto retry behavior by clearing the cached loader after a rejected native crypto import, retains approval-reaction test resets, keeps transport startup and teardown behavior unchanged, preserves test dependency overrides, and does not move hot entrypoint imports across lazy boundaries.The change removes 283 net lines without adding a second runtime path or changing configuration, protocol, or user-facing behavior.
User Impact
No intended user-visible behavior change. Maintainers get one consistent lazy-loader implementation across Matrix, WhatsApp, Signal, iMessage, Feishu, IRC, LINE, Teams, QQBot, voice-call, Zalo/ZaloUser, device-pair, and Google Meet, with fewer bespoke cache variables and reset wrappers to maintain.
Evidence
tbx_01kwjt4adhdz5ydzh5wh8b5123(Actions run28632803151).tbx_01kwjsj1awxz3d2wb5zwmt6b51: focused formatting and extension lint passed, extensions typecheck passed, full build passed, and import-cycle check reported 0 runtime value cycles (Actions run28632456395).