Summary
CLI commands consistently fail with gateway closed (1000 normal closure): no close reason while the gateway itself runs perfectly — messages flow, cron jobs execute, channels are connected. The CLI is completely non-functional for any gateway interaction.
Environment
- OpenClaw version: 2026.3.13
- Node: v22.22.1
- OS: Linux 6.12.63+deb13-amd64 (Debian 13)
- Gateway bind: loopback (127.0.0.1:18789)
- Auth mode: token
What works
- Gateway service is running (systemd, active/running)
- HTTP dashboard reachable at http://127.0.0.1:18789/
- Telegram channel: fully functional (send/receive)
- WhatsApp channel: functional for inbound (outbound has separate listener bug)
- Cron jobs: executing on schedule (confirmed via run history files)
- Messages flow normally between channels and agents
What's broken
Every CLI command that connects to the gateway fails:
$ openclaw cron list
gateway connect failed: Error: gateway closed (1000):
Error: gateway closed (1000 normal closure): no close reason
Gateway target: ws://127.0.0.1:18789
Source: local loopback
$ openclaw gateway probe --json
{
ok: false,
targets: [{
id: localLoopback,
kind: localLoopback,
url: ws://127.0.0.1:18789,
active: true,
connect: { ok: false, latencyMs: null, error: timeout, close: null }
}]
}
Same failure pattern for: openclaw cron edit, openclaw cron list, openclaw gateway call status, openclaw status (when it tries WS), openclaw message send.
Reproduction
- Install OpenClaw 2026.3.13 via npm global
- Configure gateway with loopback bind and token auth
- Start gateway via systemd
- Confirm gateway is running:
curl http://127.0.0.1:18789/ → HTTP 200
- Run any CLI command:
openclaw cron list or openclaw gateway probe
- Observe: gateway closed (1000) error
Gateway logs
Gateway journal shows WebSocket handshake timeouts:
[ws] handshake timeout conn=... remote=127.0.0.1
[ws] closed before connect conn=... remote=127.0.0.1 ... code=1000 reason=n/a
Workaround
Edit cron jobs directly via ~/.openclaw/cron/jobs.json and restart gateway with systemctl. This works because the gateway reads the file directly — only the CLI↔gateway WS path is broken.
Related issues
Impact
High. Users cannot manage cron jobs, check gateway status, send messages via CLI, or run any diagnostics. The CLI is the primary management interface and it's completely dead. Gateway runtime is unaffected, but all operational tooling is gone.
Suspected cause
Regression in the CLI↔gateway WebSocket handshake path (GatewayClient.sendConnect or the challenge/response flow). HTTP works, WS challenge is emitted, but the CLI never completes the handshake — gets a 1000 close instead.
Summary
CLI commands consistently fail with
gateway closed (1000 normal closure): no close reasonwhile the gateway itself runs perfectly — messages flow, cron jobs execute, channels are connected. The CLI is completely non-functional for any gateway interaction.Environment
What works
What's broken
Every CLI command that connects to the gateway fails:
Same failure pattern for:
openclaw cron edit,openclaw cron list,openclaw gateway call status,openclaw status(when it tries WS),openclaw message send.Reproduction
curl http://127.0.0.1:18789/→ HTTP 200openclaw cron listoropenclaw gateway probeGateway logs
Gateway journal shows WebSocket handshake timeouts:
Workaround
Edit cron jobs directly via
~/.openclaw/cron/jobs.jsonand restart gateway with systemctl. This works because the gateway reads the file directly — only the CLI↔gateway WS path is broken.Related issues
Impact
High. Users cannot manage cron jobs, check gateway status, send messages via CLI, or run any diagnostics. The CLI is the primary management interface and it's completely dead. Gateway runtime is unaffected, but all operational tooling is gone.
Suspected cause
Regression in the CLI↔gateway WebSocket handshake path (GatewayClient.sendConnect or the challenge/response flow). HTTP works, WS challenge is emitted, but the CLI never completes the handshake — gets a 1000 close instead.