Skip to content

fix(feishu): add wsConfig with PingInterval/PingTimeout to WSClient#45674

Closed
alex-xuweilong wants to merge 1 commit intoopenclaw:mainfrom
alex-xuweilong:fix/feishu-ws-client-ping-config
Closed

fix(feishu): add wsConfig with PingInterval/PingTimeout to WSClient#45674
alex-xuweilong wants to merge 1 commit intoopenclaw:mainfrom
alex-xuweilong:fix/feishu-ws-client-ping-config

Conversation

@alex-xuweilong
Copy link
Copy Markdown

Summary

Fixes the Feishu WebSocket long connection failure that blocks all enterprise users from using WebSocket mode (100% reproducible).

Root Cause

createFeishuWSClient() in extensions/feishu/src/client.ts creates a Lark.WSClient without the wsConfig parameter. The Lark SDK expects wsConfig.PingInterval and wsConfig.PingTimeout to be set — without them, the SDK throws:

[error]: [ '[ws]', 'code: 1000040351, system busy' ]
[error]: [ '[ws]', "Cannot read properties of undefined (reading 'PingInterval')" ]
[error]: [ '[ws]', 'connect failed' ]

This makes WebSocket mode completely non-functional, forcing users to fall back to webhook mode which requires a public URL.

Fix

Added wsConfig: { PingInterval: 30, PingTimeout: 5 } to the WSClient constructor, matching the Lark SDK's expected configuration.

Testing

  • pnpm build passes (note: pre-existing chrome-mcp.ts type errors unrelated to this change)
  • Linting passes clean

Fixes #42354

The Feishu WebSocket client was created without wsConfig, causing the
Lark SDK to fail with 'code: 1000040351, system busy' and 'Cannot read
properties of undefined (reading PingInterval)'. This made WebSocket
mode completely non-functional, forcing users to fall back to webhook
mode which requires a public URL.

Adds PingInterval: 30 and PingTimeout: 5 to match the Lark SDK's
expected configuration.

Fixes openclaw#42354
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS labels Mar 14, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 14, 2026

Greptile Summary

This PR fixes a critical, 100% reproducible bug where createFeishuWSClient() passed no wsConfig to Lark.WSClient, causing the Lark SDK to throw "Cannot read properties of undefined (reading 'PingInterval')" and making WebSocket mode entirely non-functional for all enterprise users.

The fix is minimal and correct — adding wsConfig: { PingInterval: 30, PingTimeout: 5 } directly to the WSClient constructor call, matching the Lark SDK's expected configuration shape.

  • The chosen values (30 s ping interval, 5 s timeout) are standard WebSocket keep-alive defaults and are consistent with Lark SDK documentation examples.
  • The change is well-scoped: it touches only the one constructor call that was broken and does not affect the HTTP client, caching logic, or any other path.
  • No issues found; the PR is safe to merge.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted fix for a well-understood crash with no risk of regression.
  • The change is a single-constructor property addition that directly addresses the root cause (the Lark SDK unconditionally dereferencing wsConfig). The values are reasonable defaults (30 s interval, 5 s timeout). No existing behaviour is modified; the fix only adds what was previously missing.
  • No files require special attention.

Last reviewed commit: d3c1e3f

@davidemanuelDEV
Copy link
Copy Markdown
Contributor

Review: ✅ LGTM

Clean XS fix. Adding WebSocket keep-alive config (30s ping interval, 5s timeout) prevents stale Feishu WS connections from silently dying. No breaking changes, no side effects. Ship it.

@alex-xuweilong
Copy link
Copy Markdown
Author

Thanks for the review! 🦞

@vincentkoc
Copy link
Copy Markdown
Member

ProjectClownfish could not safely update this branch, so it opened a narrow replacement PR instead.

Replacement PR: #72411
Source PR: #45674
Contributor credit is preserved in the replacement PR body and changelog plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Feishu/Lark] WebSocket long connection fails - code: 1000040351, system busy

3 participants