Skip to content

Gateway WebSocket handshake timeout on loopback affects active-memory, streaming, and embedded runs #74323

@hfgwq2dgx8-tech

Description

@hfgwq2dgx8-tech

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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