Skip to content

refactor(shared): consolidate Discord Slack and Telegram lazy loaders#99298

Merged
RomneyDa merged 1 commit into
mainfrom
refactor/lazy-runtime-discord-slack-telegram
Jul 3, 2026
Merged

refactor(shared): consolidate Discord Slack and Telegram lazy loaders#99298
RomneyDa merged 1 commit into
mainfrom
refactor/lazy-runtime-discord-slack-telegram

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 3, 2026

Copy link
Copy Markdown
Member

Related: #98748

What Problem This Solves

OpenClaw still has duplicated hand-written lazy dynamic-import memoizers across the Discord, Slack, and Telegram plugins. Keeping those loaders separate makes their caching and rejection behavior easier to drift and harder to audit consistently.

Why This Change Was Made

This is PR 4 of 6 in the lazy-runtime utility consolidation series. It replaces the owned Discord, Slack, and Telegram module memoizers with the shared lazy-runtime helpers while preserving transport startup and teardown, approval and model-picker resets, cached rejection behavior, and the existing hot-entrypoint import boundaries.

Series progress:

  • PR 1: #99261 established the shared lazy-runtime loader foundation.
  • PR 2: #99278 consolidated core leaf lazy loaders.
  • PR 3: the preceding gateway batch.
  • PR 4: this Discord, Slack, and Telegram batch.
  • PR 5: remaining channel and plugin lazy loaders.
  • PR 6: final residual loader cleanup and series-wide audit.

User Impact

There is no intended user-visible behavior change. Developers get one shared implementation for cached lazy module loading across these three plugins, reducing duplicate code and future semantic drift.

Evidence

  • Discord focused tests: 10 files, 313 tests passed.
  • Slack focused tests: 8 files, 195 tests passed.
  • Telegram focused tests: 10 files, 311 tests passed.
  • Blacksmith Testbox through Crabbox tbx_01kwjsbw294jxsfnyzfv6rz4qk: scoped oxfmt, extension oxlint, tsgo:extensions, tsgo:extensions:test, full build, and import-cycle check passed.
  • Import audit found no remaining hand-written module promise memoizers and no runtime static-plus-dynamic import overlap in the owned paths.
  • Startup topology did not change, so an isolated memory profile was not warranted.
  • Fresh Codex autoreview completed cleanly with no accepted or actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram size: L maintainer Maintainer-authored PR labels Jul 3, 2026
@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(shared): consolidate Discord Slack and Telegram lazy loaders This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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

Labels

channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant