Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
Title: [Bug]: Gateway WebSocket handshake/request regression in 2026.4.25+ — TUI cannot connect on low-core hosts
Body:
Environment
- OpenClaw: 2026.4.25 and 2026.4.26 (regression vs 2026.4.14)
- OS: Debian bookworm (2 CPU, 3.8GB RAM)
- Node: 22.22.2
- Gateway: loopback, token auth, 9 plugins, Telegram + Slack channels
Description
After updating from 2026.4.14 to 2026.4.25, the TUI cannot connect to the gateway.
WebSocket handshake completes but subsequent RPC requests (agents.list, chat.history)
take 2-29 seconds, exceeding the 30s requestTimeoutMs.
On 2026.4.14 with identical config and hardware, TUI connects instantly.
Steps to Reproduce
- Working gateway on 2026.4.14, TUI connects instantly
npm install -g openclaw@2026.4.25(or 2026.4.26)openclaw gateway restartopenclaw tui— stuck at "connecting | idle", eventually "gateway request timeout for connect"
Gateway Logs
Gateway shows requests completing but extremely slowly:
agents.list: 1723mschat.history: 28844ms (nearly hits 30s requestTimeoutMs)
Channels (Telegram, Slack) and HTTP dashboard work fine. Only WebSocket RPC is slow.
Related Issues
- Local gateway websocket handshake times out on 127.0.0.1:18789 and closes before connect #51987, WebSocket CLI connection fails after upgrade to 2026.3.13 — handshake timeout on loopback #47265, bug: DEFAULT_HANDSHAKE_TIMEOUT_MS too aggressive (3s) — causes spurious disconnects #47931, [Bug]: CLI WebSocket handshake timeout when gateway is running (v2026.3.13, Windows) #50380 — same handshake timeout pattern
- Root cause appears to be event loop contention during channel/plugin initialization
that now persists beyond startup in 2026.4.25+
Workaround
Downgrade to 2026.4.14: npm install -g openclaw@2026.4.14
Open https://github.com/openclaw/openclaw/issues/new and paste this in.
Sources:
- Local gateway websocket handshake times out on 127.0.0.1:18789 and closes before connect #51987
- bug: DEFAULT_HANDSHAKE_TIMEOUT_MS too aggressive (3s) — causes spurious disconnects #47931
- WebSocket CLI connection fails after upgrade to 2026.3.13 — handshake timeout on loopback #47265
- [Bug]: CLI WebSocket handshake timeout when gateway is running (v2026.3.13, Windows) #50380
Steps to reproduce
Steps to Reproduce
- Working gateway on 2026.4.14, TUI connects instantly
npm install -g openclaw@2026.4.25(or 2026.4.26)openclaw gateway restartopenclaw tui— stuck at "connecting | idle", eventually "gateway request timeout for connect"
Expected behavior
Steps:
- Working gateway on 2026.4.14, TUI connects instantly
- npm install -g openclaw@2026.4.25
- openclaw gateway restart
- openclaw tui — stuck at "connecting | idle", eventually "gateway request timeout for connect"
Actual behavior
Description/Steps to reproduce:
After updating from 2026.4.14 to 2026.4.25, the TUI cannot connect to the gateway. WebSocket handshake completes but subsequent RPC requests (agents.list, chat.history) take 2-29 seconds, exceeding the 30s requestTimeoutMs. On
2026.4.14 with identical config and hardware, TUI connects instantly.
OpenClaw version
2026.4.25 and 2026.4.26 (regression vs 2026.4.14)
Operating system
Debian bookworm, 2 CPU, 3.8GB RAM, Node 22.22.2
Install method
No response
Model
claude-sonnet-4-6
Provider / routing chain
anthropic-messages (direct API key, no router)
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Vksh07 commentedon Apr 28, 2026
same issue: websocket error and handshake timeout. gateway takes as much as 6 min in wsl @shakkernerd
steipete commentedon Apr 29, 2026
Fixed on
mainby 7e41913 and 7994833.The two slow TUI startup paths from this report are now covered:
chat.historyno longer waits on model catalog discovery; the regression test insrc/gateway/server.chat.gateway-server-chat-b.test.tsasserts thatchat.historyreturns without callingloadGatewayModelCatalog.GatewayClient, so the client-side connect watchdog no longer stays shorter than the Gateway's configured handshake window. The TUI regression test insrc/tui/gateway-chat.test.tscovers that connection option, andsrc/gateway/client.watchdog.test.tscovers the watchdog behavior.I rechecked the relevant path on current
main:agents.listis config-only insrc/gateway/server-methods/agents.ts,chat.historystays on session history insrc/gateway/server-methods/chat.ts, and the TUI connection wiring is insrc/tui/gateway-chat.ts.Verification run locally after the
mainpush:That passed 2 shards / 30 tests. I also reran the previously slow Claude history backfill test after it timed out in a larger mixed run; the focused rerun passed.