openclaw - 💡(How to fix) Fix 2026.5.22: CLI hangs on Windows — provider auth-state pre-warm blocks all CLI commands

Official PRs (…)
ON THIS PAGE

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…

After upgrading from 2026.5.20 to 2026.5.22 via npm i -g openclaw@latest, every openclaw CLI command either hangs indefinitely or takes 30-60+ seconds before producing any output. Downgrading to 2026.5.20 immediately restores normal sub-second CLI performance. This is 100% reproducible across multiple CLI commands and persists after all configuration troubleshooting steps.

Error Message

  1. --non-interactive mode should produce output even if pre-warm is stuck — at minimum, show the banner and partial diagnostic output, or a clear timeout error message indicating which provider failed.

Root Cause

The 2026.5.22 changelog introduced provider auth-state pre-warm at startup:

Models/perf: pre-warm the provider auth-state map at gateway startup so /models and every model-listing call short-circuits the per-provider plugin / external-CLI discovery on the hot path. Per-call cost drops from ~20 s to ~5 ms (~4,100×); the one-time startup warm resets and re-warms after hot reloads.

This pre-warm runs at CLI startup (not just gateway), synchronously blocking all CLI commands while it discovers and auth-checks every configured provider.

A subsequent fix was included in the same release:

Gateway: defer provider auth-state prewarm until after startup readiness so early gateway tool/session requests are not blocked by provider auth discovery. (#85272)

However, this defer only applies to the gateway's internal startup sequence — the CLI commands still execute the pre-warm synchronously and hang. With 8 providers configured (including several external/custom APIs), one or more endpoints cause the pre-warm to hang — likely a network timeout or unreachable endpoint during the auth-state discovery.

Note: openclaw gateway stop works fine even on 2026.5.22 — this command likely does NOT trigger the pre-warm, which explains the inconsistency.

Fix Action

Fix / Workaround

  • Affected: All Windows users upgrading to 2026.5.22 with multiple external/custom API providers configured
  • Severity: Critical — completely blocks CLI usage (cannot run doctor, check --version, manage gateway, or use any CLI diagnostic command)
  • Frequency: 100% reproducible — 12/12 attempts across 6 different CLI commands, across multiple gateway stop/start cycles
  • Consequence: Impossible to diagnose or fix configuration issues via CLI. Users must manually downgrade to 2026.5.20 via npm. Gateway startup also significantly delayed (30-60s vs <5s).
  • Time wasted: 2+ hours of troubleshooting across multiple sessions trying config changes that had zero effect

Only workaround: npm i -g [email protected]

Code Example

npm i -g openclaw@latest
added 71 packages, removed 151 packages, and changed 331 packages in 52s

---

openclaw --version
OpenClaw 2026.5.22 (a374c3a)

---

openclaw doctor --non-interactive
(hangs forever — no output, not even the "OpenClaw T" ASCII banner)

---

openclaw doctor --non-interactive
OpenClaw 2026.5.20 (e510042)<splash text>
[full diagnostic output follows]

---

openclaw doctor --non-interactive > out.txt 2>&1
(hangs — out.txt is 0 bytes after Ctrl+C)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from 2026.5.20 to 2026.5.22 via npm i -g openclaw@latest, every openclaw CLI command either hangs indefinitely or takes 30-60+ seconds before producing any output. Downgrading to 2026.5.20 immediately restores normal sub-second CLI performance. This is 100% reproducible across multiple CLI commands and persists after all configuration troubleshooting steps.

Steps to reproduce

  1. Install OpenClaw 2026.5.20: npm i -g [email protected]
  2. Run openclaw --version — output appears <1s (instant)
  3. Run openclaw doctor --non-interactive — full diagnostic output in ~3s
  4. Run openclaw doctor --fix --non-interactive --yes — completes normally in ~5s
  5. Run openclaw gateway stop — completes <2s
  6. Upgrade: npm i -g openclaw@latest52s install time (added 71 packages, removed 151 packages, changed 331 packages)
  7. Run openclaw --version30-60s delay before "OpenClaw 2026.5.22 (a374c3a)" appears
  8. Run openclaw doctor --non-interactive — process hangs indefinitely with ZERO output (not even the ASCII art header). Must Ctrl+C.
  9. Run openclaw doctor --fix --non-interactive --yes — same: hangs indefinitely, zero output
  10. Run openclaw doctor --non-interactive > out.txt 2>&1hangs, output file is 0 bytes
  11. Run openclaw gateway start30-60s delay before returning
  12. Downgrade: npm i -g [email protected] — all commands instantly fast again

Expected behavior

All CLI commands should return instantly (as observed in 2026.5.20):

  • openclaw --version: <1s
  • openclaw doctor --non-interactive: <5s with full diagnostic output
  • openclaw doctor --fix --non-interactive --yes: <10s, applies fixes, produces output
  • openclaw gateway stop/start: <5s

Actual behavior

Command2026.5.202026.5.22
openclaw --version<1s30-60s
openclaw doctor --non-interactive~3sHANGS (no output)
openclaw doctor --fix --non-interactive --yes~5sHANGS (no output)
openclaw doctor (interactive)~3sHANGS (no output)
openclaw doctor > out.txt 2>&1~3s (file populated)HANGS (0 byte file)
openclaw gateway stop<2s<2s (this one works)
openclaw gateway start<5s30-60s

The process consumes negligible CPU while hung (idle/waiting state). Ctrl+C terminates the process but produces ZERO output — not even the OpenClaw ASCII art banner.

OpenClaw version

  • Broken: 2026.5.22 (a374c3a)
  • Working: 2026.5.20 (e510042)

Operating system

Windows 11 Version 24H2 — Build 10.0.26200.8457 (x64) Node.js v25.9.0

Install method

npm global (npm i -g openclaw@latest)

The upgrade produced: added 71 packages, removed 151 packages, and changed 331 packages in 52s (shrinkwrap-based lockfile introduced in 2026.5.22 caused major dependency tree rebuild)

Model

N/A — CLI-level hang, no model involvement

Provider / routing chain

N/A — hang occurs before any model/provider call (the provider auth-state pre-warm is the suspected cause, see Root Cause Analysis below)

Additional provider/model setup details

8 providers configured:

  • custom-api-deepseek-com — custom OpenAI-compatible API with apiKey
  • moonshot — Kimi K2.6 API with apiKey
  • opencode-go — custom OpenCode Go API with api: openai-completions and apiKey
  • ollama — local Ollama instance
  • ollama-cloud — Ollama Cloud
  • +3 additional built-in providers

System state:

  • 2 agents: main + regi
  • 22 cron jobs active (19 use opencode-go/deepseek-v4-flash, 3 use custom-api-deepseek-com/*)
  • 31 skills loaded, 8 plugins enabled, 83 plugins disabled
  • plugins.allow is restrictive (whitelist mode); plugins.bundledDiscovery was in legacy mode
  • updates.checkOnStartup: false (disabled — no effect on the hang)

Gateway state (from 2026.5.20 doctor):

  • Gateway last run exit code: 267014, last run time: 2026-05-24 13:04:05 CEST
  • "Service is loaded but not running (likely exited immediately)"
  • Gateway was started via doctor --fix interactive prompt and appeared to start

Doctor warnings on 2026.5.20 (for context):

  • models.providers.opencode-go is set; this overrides the built-in OpenCode Go catalog (removed during troubleshooting)
  • agents.list[1].model (id=regi) is "custom-api-deepseek-com/deepseek-v4-pro", a bare string with no fallbacks
  • No command owner is configured
  • channels.telegram: multiple accounts are configured but no explicit default
  • Plaintext API keys detected in openclaw.json (8+ secret-bearing fields)

Logs, screenshots, and evidence

npm install output:

npm i -g openclaw@latest
added 71 packages, removed 151 packages, and changed 331 packages in 52s

2026.5.22 — version command (30-60s delay):

openclaw --version
OpenClaw 2026.5.22 (a374c3a)

2026.5.22 — doctor hangs (no output, must Ctrl+C):

openclaw doctor --non-interactive
(hangs forever — no output, not even the "OpenClaw T" ASCII banner)

2026.5.20 — same command, instant:

openclaw doctor --non-interactive
OpenClaw 2026.5.20 (e510042) — <splash text>
[full diagnostic output follows]

2026.5.22 — redirect attempt produces 0 byte file:

openclaw doctor --non-interactive > out.txt 2>&1
(hangs — out.txt is 0 bytes after Ctrl+C)

Impact and severity

  • Affected: All Windows users upgrading to 2026.5.22 with multiple external/custom API providers configured
  • Severity: Critical — completely blocks CLI usage (cannot run doctor, check --version, manage gateway, or use any CLI diagnostic command)
  • Frequency: 100% reproducible — 12/12 attempts across 6 different CLI commands, across multiple gateway stop/start cycles
  • Consequence: Impossible to diagnose or fix configuration issues via CLI. Users must manually downgrade to 2026.5.20 via npm. Gateway startup also significantly delayed (30-60s vs <5s).
  • Time wasted: 2+ hours of troubleshooting across multiple sessions trying config changes that had zero effect

Additional information

Root Cause Analysis

The 2026.5.22 changelog introduced provider auth-state pre-warm at startup:

Models/perf: pre-warm the provider auth-state map at gateway startup so /models and every model-listing call short-circuits the per-provider plugin / external-CLI discovery on the hot path. Per-call cost drops from ~20 s to ~5 ms (~4,100×); the one-time startup warm resets and re-warms after hot reloads.

This pre-warm runs at CLI startup (not just gateway), synchronously blocking all CLI commands while it discovers and auth-checks every configured provider.

A subsequent fix was included in the same release:

Gateway: defer provider auth-state prewarm until after startup readiness so early gateway tool/session requests are not blocked by provider auth discovery. (#85272)

However, this defer only applies to the gateway's internal startup sequence — the CLI commands still execute the pre-warm synchronously and hang. With 8 providers configured (including several external/custom APIs), one or more endpoints cause the pre-warm to hang — likely a network timeout or unreachable endpoint during the auth-state discovery.

Note: openclaw gateway stop works fine even on 2026.5.22 — this command likely does NOT trigger the pre-warm, which explains the inconsistency.

Troubleshooting Attempted (ALL on 2026.5.20, then tested on 2026.5.22 with no improvement)

  1. openclaw config unset models.providers.opencode-go — no effect
  2. Set plugins.bundledDiscovery: "allowlist" — no effect
  3. Disabled updates.checkOnStartup — no effect
  4. Manually removed models.providers.opencode-go from openclaw.json — no effect
  5. Set Telegram defaultAccount: "viktor" — no effect
  6. Set commands.ownerAllowFrom — no effect
  7. Added regi agent fallback model — no effect
  8. Redirect to file (> out.txt 2>&1) — hangs with 0 byte file
  9. Interactive doctor — hangs before any output appears
  10. Gateway stop → start cycle — stop works, start delayed

Only workaround: npm i -g [email protected]

Requested Fix

  1. Provider auth-state pre-warm must not block CLI commands. Options:

    • Add a config option to disable pre-warm (e.g., models.providerWarmup: false)
    • Skip pre-warm entirely for CLI (only gateway needs the warmup for /models endpoint)
    • Add a timeout with graceful degradation — if a provider doesn't respond within 5s, skip it and continue
    • Log which provider is being checked so users can identify the culprit
  2. --non-interactive mode should produce output even if pre-warm is stuck — at minimum, show the banner and partial diagnostic output, or a clear timeout error message indicating which provider failed.

Regression

  • Last known good: 2026.5.20 (e510042) — all CLI commands <5s
  • First known bad: 2026.5.22 (a374c3a) — CLI commands hang
  • The 2026.5.22 npm install rebuilt the entire dependency tree: 151 removed, 71 added, 331 changed (shrinkwrap-based lockfile)
  • openclaw gateway stop is the only command that consistently works on 2026.5.22 (does not trigger pre-warm)

Additional Observations

  • The hang time is variable: --version eventually returns after 30-60s, but doctor --non-interactive never returns (tested waiting 5+ minutes)
  • CPU utilization during hang is negligible — the process is in a wait/blocked state (likely waiting on a network socket)
  • The openclaw doctor on 2026.5.20 shows gateway exit code 267014 and "Service is loaded but not running (likely exited immediately)" — the 2026.5.22 gateway was killed mid-startup due to the hang
  • This affects a production system with 22 active cron jobs, 31 skills, and real-time Telegram bot traffic

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

All CLI commands should return instantly (as observed in 2026.5.20):

  • openclaw --version: <1s
  • openclaw doctor --non-interactive: <5s with full diagnostic output
  • openclaw doctor --fix --non-interactive --yes: <10s, applies fixes, produces output
  • openclaw gateway stop/start: <5s

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 2026.5.22: CLI hangs on Windows — provider auth-state pre-warm blocks all CLI commands