openclaw - ๐Ÿ’ก(How to fix) Fix [UX]: openclaw doctor produces no streamed progress during long-running phases (npm install of bundled plugin runtime deps) [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#72775โ€ขFetched 2026-04-28 06:32:20
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
closed ร—1commented ร—1mentioned ร—1subscribed ร—1

openclaw doctor (and especially doctor --fix) can run for several minutes with no streamed output. When stdout is captured/piped, no output appears until the process exits or is killed; even on TTY, the long npm-install phase has no spinner or progress text. From the operator's perspective, it's indistinguishable from a hang.

Root Cause

openclaw doctor (and especially doctor --fix) can run for several minutes with no streamed output. When stdout is captured/piped, no output appears until the process exits or is killed; even on TTY, the long npm-install phase has no spinner or progress text. From the operator's perspective, it's indistinguishable from a hang.

Code Example

node /path/to/openclaw/dist/index.js doctor 2>&1 | tail -40
RAW_BUFFERClick to expand / collapse

Summary

openclaw doctor (and especially doctor --fix) can run for several minutes with no streamed output. When stdout is captured/piped, no output appears until the process exits or is killed; even on TTY, the long npm-install phase has no spinner or progress text. From the operator's perspective, it's indistinguishable from a hang.

Environment

  • OpenClaw 2026.4.24
  • Node v25.8.0
  • Linux 6.12.0
  • IPv4-only network egress (slows npm install)

Observed

A doctor --fix invocation that needs to install ~60 bundled plugin runtime deps:

  • TTY mode: clack intro/outro banners print fine, but the npm-install span shows nothing for 3โ€“5 minutes.
  • Non-TTY (node ... doctor 2>&1 | tail -40 or shell redirect): zero stdout flushed for the entire run; output is dumped only when the process exits. A SIGTERM to the doctor process flushes buffered output.

I have one observed instance where a doctor (no --fix) ran ~6 minutes due to silently triggering the same npm install path internally; the operator only confirmed it was alive via pgrep and ls on the npm cache _logs/ directory.

Suspected cause

  • src/flows/doctor-health.ts uses @clack/prompts intro/outro which render via raw TTY sequences. In non-TTY contexts these are buffered until process exit.
  • The bundled-runtime-deps install at src/plugins/bundled-runtime-deps.ts spawnBundledRuntimeDepsInstall (line ~1590) collects child.stdout/child.stderr into buffers (stdout: Buffer[]) and only emits them on close. There is no runtime.log("installing X of Yโ€ฆ") heartbeat while npm runs.
  • No spinner is started around the install span, so even on TTY there's no visual signal.

Impact

  • Operators can't tell whether doctor is making progress, stalled, or deadlocked.
  • In CI/log-capture contexts, no output reaches the log until the run completes โ€” defeats the purpose of running doctor in pipelines.
  • Encourages manually killing doctor (and produces zombie processes when piped through tail -N).

Expected

  • A spinner or periodic line ("installing bundled plugin runtime deps: package N of Mโ€ฆ") during long phases.
  • Stream child.stdout/child.stderr from the spawn rather than buffering until close.
  • Honor --no-color / OPENCLAW_NON_TTY to switch to a line-based progress mode that flushes per phase.

Proposed fix

  1. In spawnBundledRuntimeDepsInstall, switch from buffer-on-close to child.stdout.on('data', chunk => runtime.log?.(chunk.toString())) (gated by a verbose flag if too noisy), or emit runtime.log("installing N specs into <root>") before spawning and runtime.log("installed in Xs") after.
  2. Wrap each doctor phase with a clack.spinner so non-completion is visible on TTY.
  3. In non-TTY mode, fall back to plain console.log per phase boundary with timestamps so log capture is informative.

Repro

node /path/to/openclaw/dist/index.js doctor 2>&1 | tail -40

For multi-minute installs, observe zero output until process exit.

Reported by @dfpalhano during reliability audit.

extent analysis

TL;DR

Implement a spinner or periodic logging during long phases of the openclaw doctor command to provide visible progress and prevent the appearance of hanging.

Guidance

  • Modify spawnBundledRuntimeDepsInstall in src/plugins/bundled-runtime-deps.ts to stream child.stdout and child.stderr instead of buffering until close.
  • Wrap each doctor phase with a clack.spinner to provide a visible indicator of progress on TTY.
  • Implement a fallback to plain console.log with timestamps for non-TTY mode to ensure log capture is informative.

Example

// In spawnBundledRuntimeDepsInstall
child.stdout.on('data', chunk => runtime.log?.(chunk.toString()));

Notes

The proposed fix involves modifying the spawnBundledRuntimeDepsInstall function and adding a spinner or periodic logging to provide visible progress. This should address the issue of the openclaw doctor command appearing to hang during long phases.

Recommendation

Apply the proposed workaround by implementing a spinner or periodic logging during long phases, as this will provide visible progress and prevent the appearance of hanging.

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

openclaw - ๐Ÿ’ก(How to fix) Fix [UX]: openclaw doctor produces no streamed progress during long-running phases (npm install of bundled plugin runtime deps) [1 comments, 2 participants]