@largezhou/ddingtalk 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/monitor.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@largezhou/ddingtalk",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "OpenClaw DingTalk (钉钉) channel plugin",
5
5
  "main": "index.ts",
6
6
  "type": "module",
package/src/monitor.ts CHANGED
@@ -693,10 +693,14 @@ export function monitorDingTalkProvider(options: MonitorOptions): MonitorResult
693
693
  });
694
694
 
695
695
  // 创建钉钉 Stream 客户端
696
+ // keepAlive: true 启用 WebSocket ping/pong 心跳检测(每 8s),
697
+ // 当连接"半死不活"(TCP 未关闭但数据已无法传输)时能主动检测到并 terminate,
698
+ // 配合 autoReconnect(默认 true)触发自动重连,避免长时间静默断连。
696
699
  const client = new DWClient({
697
700
  clientId,
698
701
  clientSecret,
699
702
  debug: false,
703
+ keepAlive: true,
700
704
  });
701
705
 
702
706
  // ============================================================================