openclaw - ✅(Solved) Fix [Bug]: CLI commands hang (status/health/doctor) - timeout in ensureCliPluginRegistryLoaded [1 pull requests, 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#64306Fetched 2026-04-11 06:15:27
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2commented ×1

Root Cause

Debugging traced the hang to ensureCliPluginRegistryLoaded() being called during command bootstrap, triggering massive dynamic module loading that appears to deadlock.

openclaw --help works because it uses fast path: shouldUseRootHelpFastPath() returns true, bypassing ensureCliExecutionBootstrap()

Gateway itself works fine.

Fix Action

Fixed

PR fix notes

PR #64387: fix(plugins): include activationSourceConfig in loadOpenClawPlugins destructuring

Description (problem / solution / changelog)

Summary

  • resolvePluginLoadCacheContext returns activationSourceConfig in its result object (used to thread the original raw config through to activation-source creation)
  • loadOpenClawPlugins destructures the result but omits activationSourceConfig
  • The compiled build (2026.4.9, loader-BSIqIOsD.js) injects a diagnostic log inside loadOpenClawPlugins that references activationSourceConfig as a bare variable
  • Since the variable was never destructured, this causes ReferenceError: activationSourceConfig is not defined, crash-looping the gateway on every startup attempt

One-line fix

Add activationSourceConfig to the destructuring at loadOpenClawPlugins line ~1092.

Reproduction

  1. Install OpenClaw 2026.4.9 via pnpm/npm
  2. Start the gateway (openclaw gateway start or via LaunchAgent)
  3. Gateway crash-loops: starting...loading configuration…resolving authentication… → crash → repeat every ~4s
  4. ~/.openclaw/logs/gateway.err.log shows: Gateway failed to start: ReferenceError: activationSourceConfig is not defined

Evidence

Gateway error log (repeating every ~4 seconds):

2026-04-10T14:14:03.652+03:00 Gateway failed to start: ReferenceError: activationSourceConfig is not defined
2026-04-10T14:14:07.982+03:00 Gateway failed to start: ReferenceError: activationSourceConfig is not defined
2026-04-10T14:14:12.218+03:00 Gateway failed to start: ReferenceError: activationSourceConfig is not defined

Compiled code trace

In loader-BSIqIOsD.js:

Line ~1996resolvePluginLoadCacheContext declares and returns activationSourceConfig:

const activationSourceConfig = options.activationSourceConfig ?? options.config ?? {};
// ...
return { env, cfg, normalized, activationSourceConfig, activationSource, ... };

Line ~2336loadOpenClawPlugins destructures but omits it:

const { env, cfg, normalized, activationSource, autoEnabledReasons, ... } = resolvePluginLoadCacheContext(options);
//                              ^ missing activationSourceConfig here

Line ~2446 — a diagnostic log references it as a bare variable:

if (shouldActivate) logger.warn(`[plugins-diag] ... activation.plugins=${JSON.stringify(activationSourceConfig?.plugins ?? null)}`);
// ReferenceError: activationSourceConfig is not defined

Environment

  • OpenClaw: 2026.4.9 (0512059)
  • Node.js: v25.9.0
  • OS: macOS 26.3.1 (arm64)

AI-assisted

  • AI-assisted (Claude Code / Opus 4.6)
  • Tested locally: applied equivalent patch to compiled loader-BSIqIOsD.js, confirmed gateway starts successfully
  • I understand what the code does

Related issues

Fixes #64357

Related (same symptom family — false plugins.allow is empty warnings):

  • #62049, #64170, #62521, #63693, #63182

Possibly related (plugin loading crashes/hangs):

  • #64306, #64354

Test plan

  • pnpm build && pnpm check && pnpm test passes
  • Gateway starts without crash-loop on fresh install
  • openclaw doctor no longer shows activationSourceConfig ReferenceError

Changed files

  • scripts/check-no-raw-channel-fetch.mjs (modified, +1/-1)
  • src/plugins/loader.ts (modified, +2/-0)
  • test/scripts/lint-suppressions.test.ts (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

All CLI commands except --help and --version hang for 60+ seconds.

Affected commands:

  • openclaw status - HANG
  • openclaw health - HANG
  • openclaw doctor - HANG
  • openclaw skills - HANG
  • openclaw gateway status - HANG

Working commands:

  • openclaw --version - works instantly
  • openclaw --help - works instantly

Environment

  • OpenClaw: 2026.4.8 (9ece252)
  • Node.js: v24.14.0
  • Gateway: running on port 18789
  • OS: Windows

Root Cause

Debugging traced the hang to ensureCliPluginRegistryLoaded() being called during command bootstrap, triggering massive dynamic module loading that appears to deadlock.

openclaw --help works because it uses fast path: shouldUseRootHelpFastPath() returns true, bypassing ensureCliExecutionBootstrap()

Gateway itself works fine.

extent analysis

TL;DR

The most likely fix involves addressing the deadlock caused by dynamic module loading in ensureCliPluginRegistryLoaded() during command bootstrap.

Guidance

  • Investigate the ensureCliPluginRegistryLoaded() function to identify the root cause of the deadlock and potential solutions to avoid it.
  • Verify if the shouldUseRootHelpFastPath() logic can be applied to other commands to bypass ensureCliExecutionBootstrap() and avoid the deadlock.
  • Consider implementing a timeout or asynchronous loading mechanism for dynamic modules to prevent the deadlock.
  • Review the command bootstrap process to determine if there are any other potential bottlenecks or areas for optimization.

Example

No specific code snippet can be provided without further information on the ensureCliPluginRegistryLoaded() function and the command bootstrap process.

Notes

The provided information suggests that the issue is specific to the ensureCliPluginRegistryLoaded() function and the command bootstrap process. However, without more details on the implementation, it is difficult to provide a definitive solution.

Recommendation

Apply a workaround to bypass ensureCliExecutionBootstrap() for affected commands, similar to the --help command, until a permanent fix can be implemented.

FAIL-SAFE: Given the information provided, the above guidance points are safe and do not require additional technical details.

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