openclaw - ✅(Solved) Fix CLI text commands hang with no output while --json variants work (agents list/status) [1 pull requests, 2 comments, 3 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#74195Fetched 2026-04-30 06:27:37
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Timeline (top)
commented ×2cross-referenced ×2

Several OpenClaw CLI commands hang indefinitely in their default text output path with no stdout/stderr, while their --json variants complete successfully. The gateway is healthy and responsive, so this appears to be a CLI text/bootstrap/rendering path issue rather than a gateway availability issue.

This looks related to the existing 2026.4.x CLI hang reports, especially #63249 and #62335, but this reproduction is on 2026.4.26 and specifically shows agents list --json working while agents list hangs.

Root Cause

Several OpenClaw CLI commands hang indefinitely in their default text output path with no stdout/stderr, while their --json variants complete successfully. The gateway is healthy and responsive, so this appears to be a CLI text/bootstrap/rendering path issue rather than a gateway availability issue.

This looks related to the existing 2026.4.x CLI hang reports, especially #63249 and #62335, but this reproduction is on 2026.4.26 and specifically shows agents list --json working while agents list hangs.

Fix Action

Fixed

PR fix notes

PR #74220: Fix CLI text command hangs

Description (problem / solution / changelog)

Summary

Fixes #74195.

This PR keeps the affected human-readable CLI paths on the same lightweight, read-only startup path as their working JSON counterparts:

  • routes bare openclaw agents through the route-first agents-list implementation
  • prevents text openclaw agents list from preloading bundled plugin runtimes before output
  • keeps plain text openclaw status from running live channels.status RPC work or setup-runtime channel fallback by default
  • preserves the richer live channel behavior for explicit deep/full status paths

Root Cause

agents list --json was already optimized to avoid plugin/runtime bootstrap, but the default text path still opted into plugin loading for provider enrichment. Bare openclaw agents also fell through to the Commander parent action, which called the same text list behavior after the broader agents startup policy had already selected plugin preload.

For status, the JSON fast path skipped channel table/live-channel work, while the text path still queried channels.status and allowed setup-runtime fallback when building the channel table. That made the text path materially heavier and more likely to hit the plugin/metadata/runtime hang reported in the issue even though the gateway itself was responsive.

Fix Details

  • Add an exact route-first catalog entry for bare agents, mapped to agents-list, with loadPlugins: "never".
  • Change agents list startup policy from text-only plugin preload to loadPlugins: "never"; text output still uses config plus read-only channel metadata for useful provider/routing summaries.
  • Thread deep into the text status scan so plain status and deep status can choose different scan depth.
  • Add explicit controls to collectStatusScanOverview for live channel status and setup-runtime fallback.
  • Make default text status skip live channel status and setup-runtime fallback, while status --deep / status --all keep the richer live behavior.
  • Add focused regression coverage for agents routing/startup policy and status scan depth behavior.

Validation

  • pnpm test src/cli/command-startup-policy.test.ts src/cli/command-path-policy.test.ts src/cli/route.test.ts src/cli/program/register.agent.test.ts src/cli/program/route-args.test.ts src/cli/program/routes.test.ts src/commands/agents.commands.list.test.ts src/commands/status.scan-overview.test.ts src/commands/status.scan.test.ts src/commands/status.test.ts
  • pnpm exec oxfmt --check --threads=1 src/cli/command-catalog.ts src/cli/program/register.agent.ts src/cli/route.ts src/cli/program/routed-command-definitions.ts src/commands/agents.commands.list.ts src/commands/agents.providers.ts src/commands/status.command.ts src/commands/status.scan.ts src/commands/status.scan-overview.ts CHANGELOG.md
  • git diff --check
  • Smoke checked built CLI exits for:
    • node dist/entry.js agents list
    • node dist/entry.js agents
    • node dist/entry.js status --timeout 5000

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/cli/command-catalog.ts (modified, +9/-6)
  • src/cli/command-path-policy.test.ts (modified, +2/-0)
  • src/cli/command-startup-policy.test.ts (modified, +7/-4)
  • src/cli/program/preaction.test.ts (modified, +4/-10)
  • src/cli/program/route-args.test.ts (modified, +4/-0)
  • src/cli/program/routes.test.ts (modified, +33/-0)
  • src/commands/agents.commands.list.test.ts (modified, +13/-0)

Code Example

openclaw --version
# OpenClaw 2026.4.26 (be8c246)

openclaw health
# completes, usually around 6s

openclaw agents --help
# completes, around 5s

openclaw agents list --json
# completes, around 5s, returns expected JSON

openclaw status --json --timeout 5000
# completes, around 6-9s, returns expected JSON

---

[ws] ⇄ res ✓ health 841ms cached=true
[ws] ⇄ res ✓ channels.status 100ms

---

timeout 60 openclaw agents list
# exit 124, 0 bytes stdout, 0 bytes stderr

timeout 60 openclaw agents
# exit 124, 0 bytes stdout, 0 bytes stderr

timeout 60 openclaw status --timeout 5000
# exit 124, 0 bytes stdout, 0 bytes stderr

---

openclaw --no-color agents list
NO_COLOR=1 openclaw agents list
TERM=dumb openclaw agents list
COLUMNS=120 openclaw agents list
OPENCLAW_PLUGIN_DISCOVERY_CACHE_MS=600000 openclaw agents list

---

openclaw health                         ~5.8-6.1s
openclaw plugins registry --json        ~5.9s
openclaw plugins list --json            ~5.8s
openclaw plugins list --enabled --json  ~5.5s
RAW_BUFFERClick to expand / collapse

Summary

Several OpenClaw CLI commands hang indefinitely in their default text output path with no stdout/stderr, while their --json variants complete successfully. The gateway is healthy and responsive, so this appears to be a CLI text/bootstrap/rendering path issue rather than a gateway availability issue.

This looks related to the existing 2026.4.x CLI hang reports, especially #63249 and #62335, but this reproduction is on 2026.4.26 and specifically shows agents list --json working while agents list hangs.

Environment

  • OpenClaw: 2026.4.26 (be8c246)
  • OS: Debian GNU/Linux 13 (trixie), Linux VPS
  • Install: npm global under user octest, ~/.npm-global/bin/openclaw
  • Node tested:
    • v24.15.0 / npm 11.12.1
    • v22.22.2 / npm 10.9.7
  • Gateway: user systemd service, loopback 127.0.0.1:18789, active/running
  • Gateway ExecStart: /usr/bin/node --use-env-proxy /home/octest/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
  • Network: outbound access through local mixed HTTP/SOCKS proxy at 127.0.0.1:2080; gateway service has HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY and Node --use-env-proxy

Homebrew was removed during diagnosis; Node is now from /usr/bin/node. The issue persisted across Homebrew removal and both Node 22 and Node 24 tests.

What works

openclaw --version
# OpenClaw 2026.4.26 (be8c246)

openclaw health
# completes, usually around 6s

openclaw agents --help
# completes, around 5s

openclaw agents list --json
# completes, around 5s, returns expected JSON

openclaw status --json --timeout 5000
# completes, around 6-9s, returns expected JSON

Gateway logs confirm the WS/RPC plane is responsive, e.g.:

[ws] ⇄ res ✓ health 841ms cached=true
[ws] ⇄ res ✓ channels.status 100ms

What hangs

These commands hang with zero stdout and zero stderr until killed by timeout:

timeout 60 openclaw agents list
# exit 124, 0 bytes stdout, 0 bytes stderr

timeout 60 openclaw agents
# exit 124, 0 bytes stdout, 0 bytes stderr

timeout 60 openclaw status --timeout 5000
# exit 124, 0 bytes stdout, 0 bytes stderr

On Node 24.15.0, earlier runs also showed default text openclaw status taking 70-90s or hanging, while status --json remained fast. On Node 22.22.2, text agents list and text status still hung, while JSON variants still worked.

Variants tested

These did not fix openclaw agents list text mode:

openclaw --no-color agents list
NO_COLOR=1 openclaw agents list
TERM=dumb openclaw agents list
COLUMNS=120 openclaw agents list
OPENCLAW_PLUGIN_DISCOVERY_CACHE_MS=600000 openclaw agents list

OPENCLAW_PLUGIN_DISCOVERY_CACHE_MS=600000 slightly improves health timing, but does not fix text command hangs.

Diagnostic notes

CLI bootstrap/plugin discovery cost

Even simple commands have a baseline 5-6s startup cost:

openclaw health                         ~5.8-6.1s
openclaw plugins registry --json        ~5.9s
openclaw plugins list --json            ~5.8s
openclaw plugins list --enabled --json  ~5.5s

OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY=1 made health slower (~7.6-7.8s), so the persisted registry is being used but does not avoid the heavy bootstrap.

strace observations

For openclaw health, strace showed the child CLI does significant bootstrap/import/plugin metadata work before the first connect to the gateway; after it connects, the gateway response is fast.

For openclaw agents list text mode:

  • no stdout/stderr before timeout
  • no gateway RPC appears necessary for the failing path
  • process enters futex/worker waits / hot-loop-like behavior
  • JSON path bypasses the hang and exits

Earlier status tracing showed repeated filesystem churn over bundled extension manifests/package metadata. In one run, each dist/extensions/*/openclaw.plugin.json was checked hundreds of times in a single status invocation.

Expected behavior

openclaw agents list should print the same logical information as openclaw agents list --json and exit promptly.

openclaw status text output should not hang when openclaw status --json succeeds and the gateway is healthy.

Actual behavior

Default text-output commands hang before printing anything, while JSON variants complete.

Related issues

  • #63249 - very similar 2026.4.x CLI subcommands hang/no-output/hot-loop while gateway and JSON commands work
  • #62335 - CLI commands hang indefinitely after 2026.4.5
  • #35609 - openclaw status hangs after output
  • #11843 - CLI status/health commands hang after output / plugin runtime lifecycle

extent analysis

TL;DR

The issue can be mitigated by using the --json flag with OpenClaw CLI commands, which completes successfully, while the default text output path hangs indefinitely.

Guidance

  • Investigate the difference in behavior between the default text output and the --json flag to identify the root cause of the hang.
  • Review the strace observations to understand the bootstrap and plugin discovery process, which may be contributing to the hang.
  • Consider setting environment variables such as OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY or OPENCLAW_PLUGIN_DISCOVERY_CACHE_MS to see if they impact the behavior.
  • Examine the gateway logs to confirm that the WS/RPC plane is responsive and not contributing to the hang.

Example

No code snippet is provided as the issue is related to the behavior of the OpenClaw CLI and its interaction with the gateway, rather than a specific code snippet.

Notes

The issue appears to be related to the CLI's text output rendering path, rather than a gateway availability issue. The fact that the --json flag works successfully suggests that the issue may be related to the rendering of text output.

Recommendation

Apply a workaround by using the --json flag with OpenClaw CLI commands until the root cause of the hang can be identified and fixed. This will allow users to continue using the CLI while the issue is being investigated.

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…

FAQ

Expected behavior

openclaw agents list should print the same logical information as openclaw agents list --json and exit promptly.

openclaw status text output should not hang when openclaw status --json succeeds and the gateway is healthy.

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 - ✅(Solved) Fix CLI text commands hang with no output while --json variants work (agents list/status) [1 pull requests, 2 comments, 3 participants]