@ynhcj/xiaoyi 2.3.3 → 2.3.4

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/dist/runtime.js +15 -2
  2. package/package.json +1 -1
package/dist/runtime.js CHANGED
@@ -65,8 +65,21 @@ class XiaoYiRuntime {
65
65
  manager.on("authenticated", () => {
66
66
  console.log("XiaoYi channel authenticated");
67
67
  });
68
- manager.on("maxReconnectAttemptsReached", () => {
69
- console.error("XiaoYi channel max reconnect attempts reached");
68
+ manager.on("maxReconnectAttemptsReached", (serverId) => {
69
+ console.error(`XiaoYi channel ${serverId} max reconnect attempts reached`);
70
+ // Check if the other server is still connected and ready
71
+ const otherServerId = serverId === 'server1' ? 'server2' : 'server1';
72
+ const serverStates = manager.getServerStates();
73
+ const otherServerState = otherServerId === 'server1' ? serverStates.server1 : serverStates.server2;
74
+ if (otherServerState?.connected && otherServerState?.ready) {
75
+ console.warn(`[${otherServerId}] is still connected and ready, continuing in single-server mode`);
76
+ console.warn(`System will continue running with ${otherServerId} only`);
77
+ // Don't stop, continue with the other server
78
+ return;
79
+ }
80
+ // Only stop when both servers have failed
81
+ console.error("Both servers have reached max reconnect attempts, stopping connection");
82
+ console.error(`Server1: ${serverStates.server1.connected ? 'connected' : 'disconnected'}, Server2: ${serverStates.server2.connected ? 'connected' : 'disconnected'}`);
70
83
  this.stop();
71
84
  });
72
85
  // Connect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi",
3
- "version": "2.3.3",
3
+ "version": "2.3.4",
4
4
  "description": "XiaoYi channel plugin for OpenClaw",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",