-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Consolidate lazy dynamic-import memoizers #98748
Copy link
Copy link
Closed
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Summary
Consolidate lazy dynamic-import promise memoizers behind the shared lazy-promise owner, beginning with a bounded core batch.
Problem to solve
The repository currently contains 280 production
promise ??= import(...)memoizers across 169 files, alongside shared lazy runtime helpers already used by 137 files. The duplicate implementations repeat cache state and loader functions, split rejection semantics between helpers, and make future lifecycle fixes require broad manual edits.Proposed solution
Alternatives considered
Impact
Affected: OpenClaw maintainers and developers touching lazy runtime boundaries.
Severity: Medium maintainability risk; no known user-facing bug.
Frequency: Every new or modified lazy runtime loader.
Consequence: Repeated boilerplate, inconsistent retry behavior, and higher risk during runtime-boundary refactors.
Evidence/examples
Current
mainsearch counts:The first PR will include focused helper tests, build/import-boundary proof, duplicate search proof, and production LOC reduction.