openclaw - 💡(How to fix) Fix ERR_MODULE_NOT_FOUND for `subagent-registry.runtime.js` on every gateway boot [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71418Fetched 2026-04-26 05:13:00
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1

On every gateway boot, the openclaw-deep-observability plugin's hook registration produces three [warn] subagent cleanup finalize failed entries because an internal module file is missing from the published dist/:

[warn] subagent cleanup finalize failed (90a1fefc-8de5-430f-9a7f-2b84beb8628c): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/local/lib/node_modules/openclaw/dist/subagent-registry.runtime.js' imported from /usr/local/lib/node_modules/openclaw/dist/subagent-registry-CflSFWBm.js

(One warning per leftover subagent record; we saw 3 because there were 3 dangling subagent entries in our state.)

Error Message

On every gateway boot, the openclaw-deep-observability plugin's hook registration produces three [warn] subagent cleanup finalize failed entries because an internal module file is missing from the published dist/: [warn] subagent cleanup finalize failed (90a1fefc-8de5-430f-9a7f-2b84beb8628c): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/local/lib/node_modules/openclaw/dist/subagent-registry.runtime.js' imported from /usr/local/lib/node_modules/openclaw/dist/subagent-registry-CflSFWBm.js subagent-registry-CflSFWBm.js (a bundled chunk) does import('./subagent-registry.runtime.js') lazily during cleanup, but subagent-registry.runtime.js is not present in the npm package. The cleanup path silently swallows the error and the warning is logged.

Root Cause

On every gateway boot, the openclaw-deep-observability plugin's hook registration produces three [warn] subagent cleanup finalize failed entries because an internal module file is missing from the published dist/:

Code Example

[warn] subagent cleanup finalize failed (90a1fefc-8de5-430f-9a7f-2b84beb8628c): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/local/lib/node_modules/openclaw/dist/subagent-registry.runtime.js' imported from /usr/local/lib/node_modules/openclaw/dist/subagent-registry-CflSFWBm.js
RAW_BUFFERClick to expand / collapse

Summary

On every gateway boot, the openclaw-deep-observability plugin's hook registration produces three [warn] subagent cleanup finalize failed entries because an internal module file is missing from the published dist/:

[warn] subagent cleanup finalize failed (90a1fefc-8de5-430f-9a7f-2b84beb8628c): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/local/lib/node_modules/openclaw/dist/subagent-registry.runtime.js' imported from /usr/local/lib/node_modules/openclaw/dist/subagent-registry-CflSFWBm.js

(One warning per leftover subagent record; we saw 3 because there were 3 dangling subagent entries in our state.)

Observed behaviour

subagent-registry-CflSFWBm.js (a bundled chunk) does import('./subagent-registry.runtime.js') lazily during cleanup, but subagent-registry.runtime.js is not present in the npm package. The cleanup path silently swallows the error and the warning is logged.

Expected behaviour

Either:

  • Include subagent-registry.runtime.js in the published dist/, or
  • Inline the runtime helper into the bundle so no dynamic import() is needed.

Why it matters

Currently cosmetic (cleanup just doesn't happen), but it means orphan subagent records are never finalized and can accumulate over time. Also adds noise to logs that operators learn to ignore — bad pattern.

Environment

OpenClaw 2026.4.12 (1c0672b), npm package installed at /usr/local/lib/node_modules/openclaw/.

extent analysis

TL;DR

The issue can be fixed by including the missing subagent-registry.runtime.js file in the published dist/ directory or by inlining the runtime helper into the bundle.

Guidance

  • Verify that the subagent-registry.runtime.js file is indeed missing from the dist/ directory in the published npm package.
  • Check the build process to ensure that the file is not being excluded or ignored during the bundling process.
  • Consider inlining the runtime helper into the bundle to avoid the need for a dynamic import() statement.
  • Review the cleanup path to ensure that errors are properly handled and logged, rather than being silently swallowed.

Example

No code snippet is provided as the issue is related to a missing file in the published package, rather than a code-specific problem.

Notes

The issue is currently cosmetic, but it can lead to accumulation of orphan subagent records over time and adds noise to logs. The fix should be applied to prevent potential issues in the future.

Recommendation

Apply a workaround by inlining the runtime helper into the bundle, as this approach avoids the need for a dynamic import() statement and ensures that the cleanup process can complete successfully.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING