openclaw - ✅(Solved) Fix openclaw tui -h causes 100% CPU hang and never exits [1 pull requests, 1 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#62484Fetched 2026-04-08 03:03:40
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Root Cause

readCliBannerTaglineMode() in src/cli/banner-config-lite.ts statically imports createConfigIO from the heavy config module (~19K lines). When Commander generates help text synchronously via the addHelpText('beforeAll') callback, calling createConfigIO().loadConfig() deadlocks the main thread — the config module's transitive import graph (plugin discovery, native modules, JIT loaders) hasn't fully evaluated during Commander's synchronous help generation phase.

Fix Action

Fixed

PR fix notes

PR #62485: fix(cli): prevent 100% CPU hang on openclaw tui -h

Description (problem / solution / changelog)

Summary

  • Replace static import of heavy config module in banner-config-lite.ts with async dynamic import() behind a *.runtime.ts boundary
  • First banner render returns undefined (random tagline default) while config loads in background
  • Subsequent renders use cached result

Fixes #62484

Test plan

  • openclaw tui -h displays help instantly and exits
  • openclaw status -h still works
  • pnpm check passes
  • pnpm test src/cli/banner.test.ts passes

Changed files

  • src/cli/banner-config-lite.runtime.ts (added, +1/-0)
  • src/cli/banner-config-lite.ts (modified, +67/-8)

Code Example

openclaw tui -h
# Hangs with 100% CPU, no output, unresponsive to Ctrl+C
RAW_BUFFERClick to expand / collapse

Bug

openclaw tui -h hangs indefinitely with 100% CPU. Ctrl+C does not work; only kill -9 terminates it.

Root Cause

readCliBannerTaglineMode() in src/cli/banner-config-lite.ts statically imports createConfigIO from the heavy config module (~19K lines). When Commander generates help text synchronously via the addHelpText('beforeAll') callback, calling createConfigIO().loadConfig() deadlocks the main thread — the config module's transitive import graph (plugin discovery, native modules, JIT loaders) hasn't fully evaluated during Commander's synchronous help generation phase.

Reproduction

openclaw tui -h
# Hangs with 100% CPU, no output, unresponsive to Ctrl+C

Environment

  • macOS, Node 24.x
  • openclaw 2026.4.5+

extent analysis

TL;DR

The issue can be resolved by avoiding the synchronous import of the heavy config module during Commander's help generation phase.

Guidance

  • Identify and refactor the readCliBannerTaglineMode() function in src/cli/banner-config-lite.ts to lazily import createConfigIO from the config module, allowing the import graph to fully evaluate before generating help text.
  • Consider using asynchronous help text generation via Commander's addHelpText('afterAll') callback or a similar mechanism to avoid deadlocking the main thread.
  • Verify that the createConfigIO().loadConfig() call is not blocking the main thread by checking for any synchronous I/O operations or long-running computations.
  • Review the transitive import graph of the config module to identify potential optimization opportunities, such as reducing the number of imported modules or using a more efficient plugin discovery mechanism.

Example

// Before
import { createConfigIO } from './config-module';
const configIO = createConfigIO();

// After (lazy import)
let configIO: any;
function getConfigIO() {
  if (!configIO) {
    const { createConfigIO } = await import('./config-module');
    configIO = createConfigIO();
  }
  return configIO;
}

Notes

The provided solution assumes that the issue is caused by the synchronous import of the heavy config module during Commander's help generation phase. However, the actual root cause may be more complex, and additional debugging may be required to fully resolve the issue.

Recommendation

Apply workaround: refactor the readCliBannerTaglineMode() function to use lazy imports and asynchronous help text generation to avoid deadlocking the main thread. This approach allows for a more efficient and responsive help generation process without requiring significant changes to the underlying config module.

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