openclaw doctor openclaw status openclaw health openclaw gateway status openclaw gateway probe
通过标准:
doctor 无致命错误
gateway probe 出现
Reachable: yes
本地网关目标通常是 ws://127.0.0.1:18789
Step 5. 最小可用调用测试
openclaw agent --agent main -m"你好,请回复:安装连通通过"--json
通过标准:
命令返回 JSON
无致命报错(即使出现 gateway fallback,也要看最终是否成功返回)
Step 6. 解决 openclaw 命令找不到(PATH)
先诊断:
macOS / Linux:
npm prefix -g && echo"$PATH"
Windows(PowerShell):
npm prefix -g; echo $env:Path
修复原则:
macOS / Linux:把 $(npm prefix -g)/bin 加入 PATH
Windows:把 npm prefix -g 输出目录加入系统 PATH
Step 7. 打开控制台确认运行态
openclaw dashboard
默认地址一般为:
http://127.0.0.1:18789/
Step 8. 接入 Feishu(安装后马上做)
安装 Feishu 插件:
openclaw plugins install @openclaw/feishu
添加 Feishu 渠道:
openclaw channels add
按提示选择 Feishu,填入飞书开放平台里的 App ID 与 App Secret。
重启并检查网关:
openclaw gateway restart openclaw gateway status openclaw logs --follow
首次私聊机器人后完成配对:
openclaw pairing list feishu --json openclaw pairing approve feishu <配对码>
到这一步,OpenClaw 的'安装 + 网关 + 渠道 + 配对'闭环才算完整。
1) 安装报错:npm error code 1
安装命令:
iwr -useb https://openclaw.ai/install.ps1 | iex
首次报错表现为 npm error code 1。继续查看日志后,安装最终成功,版本可用:
openclaw --version # 2026.2.24
经验:安装阶段先看'最终版本是否可查询',不要被中间 warning 直接误导。
2) Gateway 状态异常:Scheduled Task (missing) + RPC 失败
典型现象:
openclaw gateway status 显示服务缺失
openclaw gateway probe 报 1006 或 RPC 失败
后续通过前台启动确认服务本体可运行:
openclaw gateway run --verbose
观察到 listening on ws://127.0.0.1:18789 后,说明 Gateway 主进程正常。
3) Windows 下 --force 报 lsof not found
命令:
openclaw gateway run --force --verbose
报错:
Force: Error: lsof not found; required for --force
这是平台差异问题。Windows 无 lsof 时,直接不用 --force,改用:
openclaw gateway run --verbose
三、第二阶段:模型连通与会话参数问题
1) Agent 命令缺少会话选择参数
命令:
openclaw agent -m "你好,做一次连通性自检并简短回复"--json
报错提示要求必须提供会话定位参数。修复方式:
openclaw agent --agent main -m "你好,请回复:连通测试通过"--json
2) 网关失败但回退 embedded 成功
你会看到这类提示:
Gateway agent failed; falling back to embedded
这不等于请求失败。关键看最终 JSON 是否 status: ok。
四、第三阶段:Feishu 集成与配对机制
1) 常见首次消息
飞书首次私聊机器人时常见返回:
OpenClaw: access not configured. Your Feishu user id: ou_xxx Pairing code: XXXXXXXX Ask the bot owner to approve with: openclaw pairing approve feishu XXXXXXXX