Skip to content

[Bug]: openclaw status --deep crashes when gateway is unreachable #17106

@petter-b

Description

@petter-b

Summary

openclaw status --deep crashes with an unhandled WebSocket error when the gateway is not running, instead of degrading gracefully.

Steps to reproduce

  1. Stop the gateway (openclaw gateway stop)
  2. Run openclaw status --deep

Expected behavior

status --deep skips the health probe when the gateway is unreachable and displays a clear message (e.g. "skipped (gateway unreachable)") rather than crashing.

Actual behavior

CLI crashes with a stack trace and exit code 1:

Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19213
    at Object.onClose (.../call-N_0IoBZR.js:266:10)
    ...
ELIFECYCLE  Command failed with exit code 1.

OpenClaw version

main (bd28b4ed3)

Operating system

macOS 15 (Darwin 25.3.0) — reproducible on any platform

Install method

pnpm dev

Logs, screenshots, and evidence

Root cause in src/commands/status.command.ts: the health probe (line 110) checks only opts.deep with no gatewayReachable guard and no .catch(). The adjacent lastHeartbeat call (line 126) correctly has both guards — this is an inconsistency.

Impact and severity

Affected: any user running status --deep for diagnostics when gateway is down
Severity: moderate (CLI crashes instead of showing diagnostic info)
Frequency: 100% when gateway is unreachable
Consequence: the diagnostic command fails in exactly the scenario where users need it most

Additional information

Related: #12354 (gateway crashes on network loss instead of graceful degradation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions