openclaw - 💡(How to fix) Fix Gateway WebSocket handshake timeout on loopback affects active-memory, streaming, and embedded runs [4 comments, 4 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#74323Fetched 2026-04-30 06:25:30
View on GitHub
Comments
4
Participants
4
Timeline
8
Reactions
2
Timeline (top)
commented ×4cross-referenced ×3closed ×1

The OpenClaw Gateway''s local WebSocket connections (loopback 127.0.0.1:18789) experience handshake timeouts that affect multiple subsystems: active-memory plugin, streaming output from @larksuite/openclaw-lark, and potentially other embedded sub-agent operations.

Error Message

  1. active-memory: Embedded sub-agent connects back to Gateway via WS → handshake timeout → fallback/error. Tested with all 3 models, all timeout at WS level (17-45s).

Root Cause

This is NOT a model API timeout. All model APIs (GLM-5.1, GLM-5-Turbo, DeepSeek V4 Flash) respond in <1s. The timeout occurs at the Gateway''s internal WS handshake level:

handshake timeout conn=... peer=127.0.0.1:...->127.0.0.1:18789
closed before connect code=1006 reason=n/a

Fix Action

Workaround

Disabled active-memory entirely (plugins.entries.active-memory.enabled: false). Streaming is intermittent.

Code Example

handshake timeout conn=... peer=127.0.0.1:...->127.0.0.1:18789
closed before connect code=1006 reason=n/a

---

2026-04-29T18:12:14 handshake timeout conn=39d99e01... peer=127.0.0.1:61839->127.0.0.1:18789
2026-04-29T18:12:14 closed before connect code=1006 reason=n/a
2026-04-29T19:46:49 handshake timeout conn=ca4f6570... peer=127.0.0.1:61856->127.0.0.1:18789
2026-04-29T19:46:49 closed before connect code=1006 reason=n/a
2026-04-29T19:46:59 embedded run failover decision
RAW_BUFFERClick to expand / collapse

Gateway WebSocket handshake timeout affects active-memory and streaming output

Summary

The OpenClaw Gateway''s local WebSocket connections (loopback 127.0.0.1:18789) experience handshake timeouts that affect multiple subsystems: active-memory plugin, streaming output from @larksuite/openclaw-lark, and potentially other embedded sub-agent operations.

Root Cause

This is NOT a model API timeout. All model APIs (GLM-5.1, GLM-5-Turbo, DeepSeek V4 Flash) respond in <1s. The timeout occurs at the Gateway''s internal WS handshake level:

handshake timeout conn=... peer=127.0.0.1:...->127.0.0.1:18789
closed before connect code=1006 reason=n/a

Affected Subsystems

  1. active-memory: Embedded sub-agent connects back to Gateway via WS → handshake timeout → fallback/error. Tested with all 3 models, all timeout at WS level (17-45s).
  2. Streaming output (openclaw-lark): Streaming card controller uses WS → intermittent handshake timeouts → falls back to static (non-streaming) output.
  3. Embedded runs: embedded run failover decision warnings in logs.

Environment

  • OpenClaw: 2026.4.26 (be8c246)
  • Node.js: v24.14.0
  • OS: macOS arm64 (Darwin 25.2.0)
  • Plugins: openclaw-lark 2026.4.8, active-memory (disabled as workaround)
  • Connection: WebSocket mode (loopback only)

Evidence

Log entries (timestamps UTC+8):

2026-04-29T18:12:14 handshake timeout conn=39d99e01... peer=127.0.0.1:61839->127.0.0.1:18789
2026-04-29T18:12:14 closed before connect code=1006 reason=n/a
2026-04-29T19:46:49 handshake timeout conn=ca4f6570... peer=127.0.0.1:61856->127.0.0.1:18789
2026-04-29T19:46:49 closed before connect code=1006 reason=n/a
2026-04-29T19:46:59 embedded run failover decision

Model API tests (all <1s, no timeout):

  • GLM-5.1: 0.8s response time
  • GLM-5-Turbo: 0.6s response time
  • DeepSeek V4 Flash: 0.5s response time

active-memory timeout tests (all fail at WS level):

  • GLM-5.1: 43948ms → timeout
  • GLM-5-Turbo: 43000ms → timeout
  • DeepSeek V4 Flash: 45348ms → timeout

Workaround

Disabled active-memory entirely (plugins.entries.active-memory.enabled: false). Streaming is intermittent.

Related

  • Related to #74292 (initially thought to be active-memory only, but this is a broader Gateway WS issue)

extent analysis

TL;DR

The Gateway's WebSocket handshake timeout can be mitigated by adjusting the WebSocket connection settings or disabling affected plugins like active-memory.

Guidance

  • Investigate and adjust the WebSocket connection timeout settings to prevent handshake timeouts, potentially increasing the timeout value.
  • Verify the issue by monitoring log entries for handshake timeout errors and checking the performance of affected subsystems like active-memory and streaming output.
  • Consider disabling or configuring plugins that rely on WebSocket connections, such as active-memory, to work around the issue.
  • Review related issues like #74292 for potential insights or fixes that may apply to this broader Gateway WS issue.

Example

No specific code snippet is provided due to the lack of explicit code references in the issue.

Notes

The root cause of the handshake timeout is not explicitly stated, but it is confirmed to be at the Gateway's internal WS handshake level, not a model API timeout. The provided workaround of disabling active-memory may not be a permanent solution and could have implications for system functionality.

Recommendation

Apply workaround: Disable or configure affected plugins like active-memory to mitigate the issue, as adjusting the WebSocket connection settings may require further investigation and potential code changes.

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…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING