From e3d62ede0400fc2892034ed4d7a529df05ee0059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=80=BB?= Date: Tue, 10 Mar 2026 00:35:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20OpenClaw=20=E8=BF=9E=E6=8E=A5=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=B8=BB=E5=8A=A8=E5=8F=91=E9=80=81=20connect=20?= =?UTF-8?q?=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 连接 WebSocket 后立即主动发送 connect 请求 - 兼容不发送 challenge 的服务器配置 - 保留 challenge 响应逻辑作为备用 - 添加更详细的连接日志 --- electron/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electron/main.js b/electron/main.js index 71da660..b49ae24 100644 --- a/electron/main.js +++ b/electron/main.js @@ -343,14 +343,16 @@ class OpenClawConnection { this.socket.on('open', () => { this.isConnected = true; this.reconnectAttempts = 0; - console.log('[OpenClaw] WebSocket connected, waiting for challenge...'); + console.log('[OpenClaw] WebSocket connected'); // 检查窗口是否存在 if (mainWindow && !mainWindow.isDestroyed()) { this.eventHandler('connected'); } - // 注意:不立即发送 connect,等待服务器发送 connect.challenge 后再响应 + // 主动发送 connect 请求(兼容模式:不等待 challenge) + console.log('[OpenClaw] Sending connect request...'); + this.sendConnect(); }); this.socket.on('message', (data) => {