Skip to content

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

@xifengxx

Description

@xifengxx

Bug type

Regression (worked before, now fails)

Summary

Feishu channel WebSocket long connection cannot be established. Lark console shows "No application connection detected" when saving event subscription. Error loops: "code: 1000040351, system busy" and "Cannot read properties of undefined (reading 'PingInterval')".

Steps to reproduce

  1. Configure OpenClaw Feishu channel with connectionMode: "websocket"
  2. Start Gateway: openclaw gateway
  3. Open Lark Developer Console → Events and Callbacks
  4. Select "Use long connection to receive events"
  5. Check event: im.message.receive_v1
  6. Click Save

Expected behavior

Save successful, WebSocket connection established, Lark console detects connection

Actual behavior

Error: "No application connection detected", save fails. Gateway logs show connection errors looping every 25-30s.

OpenClaw version

2026.3.8 (3caab92)

Operating system

macOS 15.x (Darwin 24.6.0 arm64)

Install method

npm install -g openclaw

Model

bailian/qwen3.5-plus

Provider / routing chain

openclaw -> bailian (DashScope)

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

[error]: [ '[ws]', 'code: 1000040351, system busy' ]
[error]: [ '[ws]', "Cannot read properties of undefined (reading 'PingInterval')" ]
[error]: [ '[ws]', 'connect failed' ]
[info]: [ 'ws', 'unable to connect to the server after trying N times")' ]

Environment:
- Node.js: v23.11.0
- Feishu Plugin: @openclaw/feishu@2026.3.8-beta.1
- Lark SDK: @larksuiteoapi/node-sdk@^1.59.0

Impact and severity

Affected: All enterprise users using Feishu/Lark channel
Severity: High (blocks Feishu channel deployment)
Frequency: 100% reproducible
Consequence: Cannot use WebSocket mode, must fallback to Webhook (requires public URL)

Additional information

Root cause: createFeishuWSClient() in extensions/feishu/src/client.ts missing wsConfig parameter.

Suggested fix:

return new Lark.WSClient({
  appId,
  appSecret,
  domain: resolveDomain(domain),
  loggerLevel: Lark.LoggerLevel.info,
  wsConfig: {
    PingInterval: 30,
    PingTimeout: 5,
  },
  ...(agent ? { agent } : {}),
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    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