refactor(shared): consolidate gateway and stateful runtime lazy loaders#99296
Merged
Conversation
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
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.
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:
Remaining batches:
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
tbx_01kwjsgnpa39k6r314s21jc6nc, Actions run https://github.com/openclaw/openclaw/actions/runs/28632429729,pnpm buildpassed.node scripts/check-import-cycles.tsreported0 runtime value cycle(s).