From 2722b9731def94964b6ae15cf06cfc94ed07ee48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=80=BB?= Date: Tue, 10 Mar 2026 03:20:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20OpenClaw=20Gateway?= =?UTF-8?q?=20=E5=8D=8F=E8=AE=AE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 错误: - client.id 写成了 'operator'(这是 mode 的值) - 应该是 'cli'(客户端标识) 根据协议文档: https://docs.openclaw.ai/zh-CN/gateway/protocol 正确的 connect 请求: { "client": { "id": "cli", // 客户端标识 "mode": "operator" // 角色:operator 或 node } } 客户端标识可以是: - cli (CLI 工具) - cli-ui (CLI UI) - macos-app (macOS 应用) - ios-node (iOS 节点) - 等等... 我们使用 'cli' 作为标识。 --- electron/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/main.js b/electron/main.js index ff9b997..3663af4 100644 --- a/electron/main.js +++ b/electron/main.js @@ -447,7 +447,7 @@ class OpenClawConnection { minProtocol: this.protocolVersion, maxProtocol: this.protocolVersion, client: { - id: 'operator' // 必须是 'operator' 或 'node', + id: 'cli', // 客户端标识:cli, cli-ui, macos-app 等, version: '1.0.0', platform: process.platform, mode: 'operator'