OpenClaw 多飞书机器人与多 Agent 团队协作实践
记录 OpenClaw 在 Windows 等多系统上的安装部署、Gateway 排障及飞书机器人接入全过程。涵盖环境检查、命令修复、模型切换(OpenAI/Ollama)、多 Agent 路由绑定及身份错位修复。最终实现产品、开发、测试等角色的多机器人协作团队落地,提供可复用的运维命令与策略建议。

记录 OpenClaw 在 Windows 等多系统上的安装部署、Gateway 排障及飞书机器人接入全过程。涵盖环境检查、命令修复、模型切换(OpenAI/Ollama)、多 Agent 路由绑定及身份错位修复。最终实现产品、开发、测试等角色的多机器人协作团队落地,提供可复用的运维命令与策略建议。


这篇文章完整记录一次从单机安装到多机器人协作落地的真实过程: 包括 Windows 安装报错、Gateway 连通、模型切换、Feishu 配对、多 Agent 路由、身份错位修复,以及最终形成'产品 - 开发 - 测试 - 评审 - 文档 - 运维'团队。
这次实践的目标很明确:
最终落地状态(已验证):
accountId 精确绑定到对应 Agentopenai-codex/gpt-5.2,文档 Agent 使用 ollama/gpt-oss:20b-cloud这一段改成'可直接复现'的跨系统安装手册,覆盖 Windows、macOS、Linux。 同时把 Feishu 接入步骤也接在安装闭环后,避免'装好了但渠道跑不起来'。
先确认 Node 和 npm:
node -v && npm -v
建议:
>= 22>= 10如果版本过低,先升级再安装 OpenClaw。
macOS / Linux:
curl -fsSL https://openclaw.ai/install.sh | bash
Windows(PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iex
安装完成后统一验证:
openclaw --version
通过标准:能返回版本号(如 2026.x.x)。
openclaw onboard --install-daemon
在向导里完成三件事:
openclaw doctor
openclaw status
openclaw health
openclaw gateway status
openclaw gateway probe
通过标准:
doctor 无致命错误gateway probe 出现 Reachable: yesws://127.0.0.1:18789openclaw agent --agent main -m "你好,请回复:安装连通通过" --json
通过标准:
openclaw 命令找不到(PATH)先诊断:
macOS / Linux:
npm prefix -g && echo "$PATH"
Windows(PowerShell):
npm prefix -g; $env:Path
修复原则:
$(npm prefix -g)/bin 加入 PATHnpm prefix -g 输出目录加入系统 PATHopenclaw dashboard
默认地址一般为:
http://127.0.0.1:18789/openclaw plugins install @openclaw/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 的'安装 + 网关 + 渠道 + 配对'闭环才算完整。
npm error code 1安装命令:
iwr -useb https://openclaw.ai/install.ps1 | iex
首次报错表现为 npm error code 1。
继续查看日志后,安装最终成功,版本可用:
openclaw --version # 2026.2.24
经验:安装阶段先看'最终版本是否可查询',不要被中间 warning 直接误导。
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 主进程正常。
--force 报 lsof not found命令:
openclaw gateway run --force --verbose
报错:
Force: Error: lsof not found; required for --force
这是平台差异问题。Windows 无 lsof 时,直接不用 --force,改用:
openclaw gateway run --verbose
命令:
openclaw agent -m "你好,做一次连通性自检并简短回复" --json
报错提示要求必须提供会话定位参数。修复方式:
openclaw agent --agent main -m "你好,请回复:连通测试通过" --json
你会看到这类提示:
Gateway agent failed; falling back to embedded
这不等于请求失败。关键看最终 JSON 是否 status: ok。
飞书首次私聊机器人时常见返回:
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
通用审批方式:
openclaw pairing approve feishu <配对码>
按账号审批方式:
openclaw pairing approve --channel feishu --account <accountId> <配对码>
实践中的关键细节:
feishu 队列里可见,但在 --account 过滤下为空No pending pairing request found 不一定是失败,可能是配对码已被消费openclaw pairing list feishu --json
我们最终搭建了 6 个飞书机器人角色,并做了账号到 Agent 的一一绑定。
核心不是'一个默认 Agent',而是'按渠道账号精确路由':
{"agentId":"pm-agent","match":{"channel":"feishu","accountId":"pm"}}
同理分别配置 dev / qa / review / docs / ops 对应各自 Agent。
openclaw channels status --json --probe
openclaw config get bindings --json
openclaw agents list --json
验证标准:
probe.ok = truebindings 包含每个 accountId -> agentId团队主体使用:
openai-codex/gpt-5.2文档机器人专门使用:
ollama/gpt-oss:20b-cloud即把'模型选择'从全局配置下沉到具体 Agent。 这样做的好处:
实际出现过:在终端 pm-agent 自测正常,但飞书里却回答成'默认小爪'。
排查后发现核心原因通常有两类:
maindispatching to agent (session=...)bindings 是否确实匹配 channel + accountIdIDENTITY.mdAGENTS.md 加'身份锁定规则'openclaw gateway start
openclaw gateway status
openclaw gateway probe
openclaw channels status --json --probe
openclaw agent --agent pm-agent -m "你是谁?只回复名称。"
openclaw agent --agent dev-agent -m "你是谁?只回复名称。"
openclaw agent --agent review-agent -m "你是谁?只回复名称。"
openclaw pairing list feishu --json
openclaw pairing approve feishu <配对码>
openclaw pairing approve --channel feishu --account ops <配对码>
openclaw gateway stop
openclaw gateway restart
status -> probe -> logs -> bindings这次实践最大的收获不是'把机器人接上了',而是把整套方法跑通了:
当你把'渠道账号、Agent 角色、模型策略、身份文件、日志验证'这 5 件事统一起来,OpenClaw 才真正从'会聊天'进入'可协作生产'的阶段。

微信公众号「极客日志」,在微信中扫描左侧二维码关注。展示文案:极客日志 zeeklog
生成新的随机RSA私钥和公钥pem证书。 在线工具,RSA密钥对生成器在线工具,online
基于 Mermaid.js 实时预览流程图、时序图等图表,支持源码编辑与即时渲染。 在线工具,Mermaid 预览与可视化编辑在线工具,online
查找任何按下的键的javascript键代码、代码、位置和修饰符。 在线工具,Keycode 信息在线工具,online
JavaScript 字符串转义/反转义;Java 风格 \uXXXX(Native2Ascii)编码与解码。 在线工具,Escape 与 Native 编解码在线工具,online
使用 Prettier 在浏览器内格式化 JavaScript 或 HTML 片段。 在线工具,JavaScript / HTML 格式化在线工具,online
Terser 压缩、变量名混淆,或 javascript-obfuscator 高强度混淆(体积会增大)。 在线工具,JavaScript 压缩与混淆在线工具,online