Skip to content

refactor(shared): consolidate gateway and stateful runtime lazy loaders#99296

Merged
RomneyDa merged 1 commit into
mainfrom
refactor/lazy-runtime-core-gateway
Jul 3, 2026
Merged

refactor(shared): consolidate gateway and stateful runtime lazy loaders#99296
RomneyDa merged 1 commit into
mainfrom
refactor/lazy-runtime-core-gateway

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 3, 2026

Copy link
Copy Markdown
Member

Related: #98748

What Problem This Solves

OpenClaw still has duplicated promise memoizers around lazy dynamic imports in core Gateway and stateful runtime paths. Those local cache owners repeat lifecycle logic, make rejection behavior easier to drift, and increase the cost of maintaining import boundaries.

This is PR 3 of 6 in the lazy-runtime utility consolidation series.

Completed dependency batches:

  • #99261 — shared lazy runtime loader foundation.
  • #99278 — core leaf lazy loader consolidation.

Remaining batches:

  • Batch 4 — Discord, Slack, and Telegram lazy loaders.
  • Batch 5 — remaining channel and plugin lazy loaders.
  • Batch 6 — residual repository sweep and consolidation cleanup.

Why This Change Was Made

This migrates the core Gateway, session/stateful, task registry, node-host, ACP, channel, and narrow Plugin SDK runtime loaders to the shared lazy-runtime owner. It preserves sticky rejection caching, explicit clear/peek test and lifecycle behavior, startup ordering, and existing dynamic import boundaries without adding SDK exports or compatibility paths.

User Impact

No intended user-visible behavior change. Maintainers get one canonical lazy-loader implementation with less duplicated production code and consistent cache semantics across these runtime paths.

Evidence

  • Existing focused proof: 547 tests across ACP, channels, agents, Gateway, SDK, node-host, and tasks.
  • Existing focused static proof: core production typecheck, oxlint, and oxfmt passed.
  • Fresh rebased build: Blacksmith Testbox-through-Crabbox tbx_01kwjsgnpa39k6r314s21jc6nc, Actions run https://github.com/openclaw/openclaw/actions/runs/28632429729, pnpm build passed.
  • Fresh rebased import graph: node scripts/check-import-cycles.ts reported 0 runtime value cycle(s).
  • Fresh autoreview before commit: no accepted/actionable findings, confidence 0.94.
  • Scope: 23 owned files, 306 insertions and 468 deletions; no changelog entry.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: L maintainer Maintainer-authored PR labels Jul 3, 2026
@RomneyDa
RomneyDa merged commit b98c11a into main Jul 3, 2026
121 of 125 checks passed
@RomneyDa
RomneyDa deleted the refactor/lazy-runtime-core-gateway branch July 3, 2026 01:43
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant