Repository navigation
fix(workers): load idle GC diagnostics lazily - #198895
Conversation
#198857 imported the subsystem logger eagerly from worker-idle-gc.ts, which every pool worker loads through worker-task-server. That pulled the logging graph into agents/identity-file.worker.js: 203 -> 240 evaluated modules, over its 220 budget (scripts/check-worker-module-budget.mjs). Load the logger with a dynamic import only on the slow (>= 1 s) collection path. The warning and its fields are unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
logging/subsystem is statically imported elsewhere, so importing it dynamically from worker-idle-gc is ineffective and fails the build guard. Import a report module that only this path loads.
|
Worker module budget on a fresh frozen install at exact head
The first commit imported |
Brings in openclaw#198895, which fixes the identity-file worker module budget guard that blocks building this head.
Resolve the idle-GC conflict using the landed runtime report boundary from #198895. Remove the superseded worker-idle-gc-log implementation; preserve the concurrency and floor-retention repairs. Main advanced after the prior complete build proof. Co-authored-by: RomneyDa <[email protected]>
* fix(workers): load idle GC diagnostics lazily openclaw#198857 imported the subsystem logger eagerly from worker-idle-gc.ts, which every pool worker loads through worker-task-server. That pulled the logging graph into agents/identity-file.worker.js: 203 -> 240 evaluated modules, over its 220 budget (scripts/check-worker-module-budget.mjs). Load the logger with a dynamic import only on the slow (>= 1 s) collection path. The warning and its fields are unchanged. * fix(workers): split idle GC report into a runtime boundary logging/subsystem is statically imported elsewhere, so importing it dynamically from worker-idle-gc is ineffective and fails the build guard. Import a report module that only this path loads.
What Problem This Solves
Main fails the worker module budget check:
agents/identity-file.worker.js: 240 evaluated modules exceeds budget 220(UI E2E build bootstrap, job 132459904267).#198857 added an eager
createSubsystemLoggerimport tosrc/infra/worker-idle-gc.ts, and every pool worker loads that module throughworker-task-server.ts. That pulled the logging graph into small workers. Lane 2491 attributed it on the exact parent: the check showed 203 evaluated modules before #198857 and 240 after.Why This Change Was Made
The logger is now loaded with a dynamic
import(), and only when an idle collection takes at least 1 s. The warning text and fields are unchanged. Workers that never hit a slow collection don't evaluate the logging graph at startup.User Impact
None at runtime. The
slow idle worker garbage collectionwarning still appears with the same fields, and main's worker module budget check passes again.Evidence
worker-idle-gc.test.ts(2) andworker-idle-gc.runtime.test.ts(1) pass. The slow-collection test now waits for the dynamic import before asserting on the warning.pnpm tsgo:core, oxfmt and oxlint are clean.