From df6383f8dc5b814703c43c18633e162b07bbd467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=80=BB?= Date: Tue, 10 Mar 2026 00:58:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20OpenClaw=20?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E8=BF=9E=E6=8E=A5=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 连接建立时显示就绪状态 - 主动发送 connect 请求(不等待 challenge) - 发送消息前显示日志 - 为后续更详细日志做准备 --- electron/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electron/main.js b/electron/main.js index 71da660..34f4d38 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 连接已建立'); console.log('[OpenClaw] 就绪状态:', this.socket.readyState, '(1=OPEN)'); // 检查窗口是否存在 if (mainWindow && !mainWindow.isDestroyed()) { this.eventHandler('connected'); } - // 注意:不立即发送 connect,等待服务器发送 connect.challenge 后再响应 + // 主动发送 connect 请求 + console.log('[OpenClaw] 📤 发送 connect 请求...'); + this.sendConnect(); }); this.socket.on('message', (data) => {