openclaw - 💡(How to fix) Fix [Bug]: 飞书无限重连Feishu WebSocket reconnect loop never stops — gateway becomes unresponsive without manual restart [1 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#59753Fetched 2026-04-08 02:40:56
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Code Example

655:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 1 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:41:38.156Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:41:38.156+08:00"}
1659:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 2 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:43:18.696Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:43:18.696+08:00"}
1663:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 3 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:44:59.112Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:44:59.112+08:00"}
1667:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 4 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:46:39.922Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:46:39.922+08:00"}
1670:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 5 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:48:20.262Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:48:20.262+08:00"}
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Problem Description

<Feishu plugin> When the Feishu WebSocket connection drops (e.g., due to Feishu server maintenance or network glitch), the Lark SDK enters a **permanent reconnect loop** with exponential backoff. The gateway process stays alive but becomes completely unresponsive — the Feishu bot goes offline and messages can neither be sent nor received. [info] [ws] unable to connect to the server after trying 890 times ← after ~24 hours

Steps to reproduce

Key observations:

  • The retry counter never resets or caps — it grows indefinitely
  • The reconnect interval grows to ~100s but never gives up
  • Feishu marks the bot as offline after prolonged disconnect
  • The openclaw channels status --probe still reports "works" even while the bot is effectively unreachable
  • Only openclaw gateway restart breaks the loop and restores connectivity

Environment

  • OpenClaw version: (2026.3.13, via npm)
  • Node.js: v22.22.1
  • OS: Linux (WSL2)
  • Feishu channel mode: WebSocket (long connection)
  • Deployment: local desktop, systemd-managed gateway

Expected behavior

Expected Behavior

According to the docs, WebSocket reconnection should use "exponential backoff with a max of 3 retries and 30s interval." In practice:

  1. The retry count has no upper limit (counter goes to 890+)
  2. There is no mechanism to force a fresh connection after many failures
  3. No watchdog or health-check triggers recovery without manual intervention

Proposed Fix

Add a watchdog mechanism at the OpenClaw gateway level:

  1. Track consecutive WebSocket reconnection failures per channel
  2. After N failures (e.g., 10–20), automatically trigger a channel re-auth (openclaw channels login) or full WebSocket session reset
  3. Consider adding a config option like channels.feishu.reconnectMaxAttempts to let users tune this behavior
  4. Alternatively, add a periodic health-check that detects "connected but non-functional" state and self-heals

Actual behavior

he retry counter never resets or caps — it grows indefinitely

  • The reconnect interval grows to ~100s but never gives up
  • Feishu marks the bot as offline after prolonged disconnect
  • The openclaw channels status --probe still reports "works" even while the bot is effectively unreachable
  • Only openclaw gateway restart breaks the loop and restores connectivity

OpenClaw version

2026.3.13

Operating system

Ubuntu(WSL2)

Install method

npm

Model

minimax 2.7

Provider / routing chain

openclaw -minimax-feishu

Additional provider/model setup details

No response

Logs, screenshots, and evidence

655:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 1 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:41:38.156Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:41:38.156+08:00"}
1659:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 2 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:43:18.696Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:43:18.696+08:00"}
1663:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 3 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:44:59.112Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:44:59.112+08:00"}
1667:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 4 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:46:39.922Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:46:39.922+08:00"}
1670:{"0":"[info]: [ 'ws', 'unable to connect to the server after trying 5 times")' ]","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-04-01T13:48:20.262Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///home/lyd/.npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852:46","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:852","fileColumn":"46","fileLine":"852","filePath":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":".npm-global/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:852","method":"console.info"}},"time":"2026-04-01T21:48:20.262+08:00"}

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Implement a watchdog mechanism to track consecutive WebSocket reconnection failures and trigger a channel re-auth or session reset after a specified number of attempts.

Guidance

  • Introduce a retry counter cap to prevent indefinite growth and implement exponential backoff with a maximum interval.
  • Develop a health-check mechanism to detect "connected but non-functional" states and trigger self-healing.
  • Consider adding a configurable option (e.g., channels.feishu.reconnectMaxAttempts) to allow users to tune the reconnect behavior.
  • Trigger a channel re-auth or full WebSocket session reset after the specified number of failed reconnect attempts.

Example

// Pseudo-code example of a watchdog mechanism
let retryCount = 0;
const maxRetries = 10; // configurable option
const reconnectInterval =

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

openclaw - 💡(How to fix) Fix [Bug]: 飞书无限重连Feishu WebSocket reconnect loop never stops — gateway becomes unresponsive without manual restart [1 participants]