openclaw配置多个agent实现飞书群聊

发布时间:2026/5/28 1:22:21

openclaw配置多个agent实现飞书群聊 本文介绍了基于飞书的多Agent系统架构设计通过OpenClaw Gateway实现飞书应用与AI Agent的对接。系统采用多Agent架构每个飞书机器人对应独立的AI Agent拥有专属的工作空间、知识库和模型配置。隔离性说明● 每个 Agent 的模型状态完全独立● 每个 agent 对应一个飞书机器人● 每个 agent 的技能单独安装维护● 模型切换仅对当前会话生效持久化到 Agent 配置● 严格隔离每个 Agent 独立 workspace 和 data添加新的 agent# 添加agentopenclaw agentsaddfinance_agent openclaw agentsaddcode_agent# 设置身份openclaw agents set-identity--agentcode_agent--name全栈开发专家#openclaw agents set-identity --agent main --name OpenClaw --emoji --avatar avatars/openclaw.png# 查看agents 列表openclaw agents list安装过程cobrewDESKTOP-9449JCG:~$ openclaw agentsaddfinance_agent ?? OpenClaw2026.3.13(61d171a)? Your AI assistant, now without the$3,499 headset. ┌ Add OpenClaw agent │ ◇ Workspace directory │ /home/cobrew/.openclaw/workspace-finance_agent │ ◇ Copy auth profiles frommain? │ Yes │ ◇ Auth profiles ─────────────────────? │ │ │ Copied auth profiles frommain.│ │ │ ├─────────────────────────────────────? │ ◇ Configure model/authforthis agent now? │ Yes │ ◇ Model/auth provider │ Xiaomi │ ◇ Howdoyou want to provide this API key? │ Paste API key now │ ◇ Enter Xiaomi API key │ sk-cidvh │ ◇ Model configured ─────────────────────────────────────────────────────? │ │ │ Default modelsetto xiaomi/mimo-v2-flashforagentfinance_agent.│ │ │ ├────────────────────────────────────────────────────────────────────────? │ ◇ Model check ──────────────────────────────────────────────────────────────────────────────? │ │ │ Model not found: xiaomi/mimo-v2-flash. Update agents.defaults.model or run /models list. │ │ │ ├────────────────────────────────────────────────────────────────────────────────────────────? │ ◇ Channel status ────────────────────────────? │ │ │ Telegram: needs token │ │ WhatsApp(default): not linked │ │ Discord: needs token │ │ Slack: needs tokens │ │ Signal: needs setup │ │ signal-cli: missing(signal-cli)│ │ iMessage: needs setup │ │ imsg: missing(imsg)│ │ IRC: not configured │ │ Google Chat: not configured │ │ LINE: not configured │ │ Feishu:installplugin toenable│ │ Google Chat:installplugin toenable│ │ Nostr:installplugin toenable│ │ Microsoft Teams:installplugin toenable│ │ Mattermost:installplugin toenable│ │ Nextcloud Talk:installplugin toenable│ │ Matrix:installplugin toenable│ │ BlueBubbles:installplugin toenable│ │ LINE:installplugin toenable│ │ Zalo:installplugin toenable│ │ Zalo Personal:installplugin toenable│ │ Synology Chat:installplugin toenable│ │ Tlon:installplugin toenable│ │ │ ├─────────────────────────────────────────────? │ ◇ Configure chat channels now? │ No Config overwrite: /home/cobrew/.openclaw/openclaw.json(sha256 4b6fcbb9743eb0a863a9a0a6fc7d5814cbe385ff -96c54ca4424a3515bc73580613b630be1f06dad8cdf09c6137b,backup/home/cobrew/.openclaw/openclaw.json.bak)Updated ~/.openclaw/openclaw.json Workspace OK: ~/.openclaw/workspace-finance_agent Sessions OK: ~/.openclaw/agents/finance_agent/sessions │ └ Agentfinance_agentready. cobrewDESKTOP-9449JCG:~$配置过程cobrewDESKTOP-9449JCG:~$ openclaw agentsaddcode_agent OpenClaw2026.3.13(61d171a)— WhatsApp automation without theplease accept our new privacy policy.11:32:30[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.11:32:57[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes11:32:57[plugins]feishu_chat: Registered feishu_chat tool11:32:57[plugins]feishu_wiki: Registered feishu_wiki tool11:32:57[plugins]feishu_drive: Registered feishu_drive tool11:32:57[plugins]feishu_bitable: Registered bitable tools ┌ Add OpenClaw agent │ ◆ Workspace directory │ /home/cobrew/.openclaw/workspace-code_agent█ └11:32:58[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.11:32:58[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes11:32:58[plugins]feishu_chat: Registered feishu_chat tool ◇ Workspace directory │ /home/cobrew/.openclaw/workspace-code_agent │ ◇ Copy auth profiles frommain? │ No │ ◇ Configure model/authforthis agent now? │ Yes12:00:47[agents/auth-profiles]inherited auth-profiles from main agent │ ◇ Model/auth provider │ Qwen12:01:29[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.12:01:29[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes12:01:29[plugins]feishu_chat: Registered feishu_chat tool12:01:29[plugins]feishu_wiki: Registered feishu_wiki tool12:01:29[plugins]feishu_drive: Registered feishu_drive tool12:01:29[plugins]feishu_bitable: Registered bitable tools12:01:29[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.12:01:29[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes12:01:29[plugins]feishu_chat: Registered feishu_chat tool12:01:29[plugins]feishu_wiki: Registered feishu_wiki tool12:01:29[plugins]feishu_drive: Registered feishu_drive tool12:01:29[plugins]feishu_bitable: Registered bitable tools │ ◓ Starting Qwen OAuth…│ ◇ Qwen OAuth ─────────────────────────────────────────────────────────────────────────╮ │ │ │ Open https://chat.qwen.ai/authorize?user_codeEFVW6ZPMclientqwen-code to approve │ │ access. │ │ If prompted, enter the code EFVW6ZPM. │ │ │ ├──────────────────────────────────────────────────────────────────────────────────────╯ ◇ Qwen OAuth failed │ ◇ Qwen OAuth ────────────────────────────────────────────────────────────────╮ │ │ │ If OAuth fails, verify your Qwen account has portal access and try again. │ │ │ ├─────────────────────────────────────────────────────────────────────────────╯ Error: Qwen OAuth timed out waitingforauthorization. cobrewDESKTOP-9449JCG:~$ openclaw agentsaddcode_agent OpenClaw2026.3.13(61d171a)— Less clicking,moreshipping, fewerwhere did that file gomoments.12:17:40[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids. ^[[B^[[B^[[B^H^H12:18:08[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes12:18:08[plugins]feishu_chat: Registered feishu_chat tool12:18:08[plugins]feishu_wiki: Registered feishu_wiki tool12:18:08[plugins]feishu_drive: Registered feishu_drive tool12:18:08[plugins]feishu_bitable: Registered bitable tools ┌ Add OpenClaw agent │ ◆ Workspace directory │ /home/cobrew/.openclaw/workspace-code_age█ └12:18:08[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.12:18:08[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes12:18:08[plugins]feishu_chat: Registered feishu_chat tool ◇ Workspace directory │ /home/cobrew/.openclaw/workspace-code_age │ ◇ Configure model/authforthis agent now? │ Yes │ ◇ Model/auth provider │ Z.AI │ ◇ Z.AI auth method │ Coding-Plan-CN12:19:36[plugins]plugins.allow is empty;discovered non-bundled plugins may auto-load: feishu(/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.12:19:36[plugins]feishu_doc: Registered feishu_doc, feishu_app_scopes12:19:36[plugins]feishu_chat: Registered feishu_chat tool12:19:36[plugins]feishu_wiki: Registered feishu_wiki tool12:19:36[plugins]feishu_drive: Registered feishu_drive tool12:19:36[plugins]feishu_bitable: Registered bitable tools │ ◇ Howdoyou want to provide this API key? │ Paste API key now │ ◇ Enter Z.AI API key │ f01d03bbba004f5 │ ◇ Model configured ───────────────────────────────────────╮ │ │ │ Default modelsetto zai/glm-5foragentcode_agent.│ │ │ ├──────────────────────────────────────────────────────────╯[info]:[client ready]│ ◇ Channel status ───────────────────────────────────────────╮ │ │ │ Telegram: needs token │ │ WhatsApp(default): not linked │ │ Discord: needs token │ │ Slack: needs tokens │ │ Signal: needs setup │ │ signal-cli: missing(signal-cli)│ │ iMessage: needs setup │ │ imsg: missing(imsg)│ │ Feishu: connected as ou_9ee6b91a4b1 │ │ IRC: not configured │ │ Google Chat: not configured │ │ LINE: not configured │ │ Google Chat:installplugin toenable│ │ Nostr:installplugin toenable│ │ Microsoft Teams:installplugin toenable│ │ Mattermost:installplugin toenable│ │ Nextcloud Talk:installplugin toenable│ │ Matrix:installplugin toenable│ │ BlueBubbles:installplugin toenable│ │ LINE:installplugin toenable│ │ Zalo:installplugin toenable│ │ Zalo Personal:installplugin toenable│ │ Synology Chat:installplugin toenable│ │ Tlon:installplugin toenable│ │ │ ├────────────────────────────────────────────────────────────╯ │ ◇ Configure chat channels now? │ Yes │ ◇ How channels work ───────────────────────────────────────────────────────────────────────╮ │ │ │ DM security: default is pairing;unknown DMs get a pairing code. │ │ Approve with: openclaw pairing approvechannelcode│ │ Public DMs requiredmPolicyopenallowFrom[*]. │ │ Multi-user DMs: run: openclaw configsetsession.dmScopeper-channel-peer(or │ │per-account-channel-peerformulti-account channels)to isolate sessions. │ │ Docs: channels/pairing │ │ │ │ Telegram: simplest way to get started — register a bot with BotFather and get going. │ │ WhatsApp: works with your own number;recommend a separate phone eSIM. │ │ Discord: very well supported right now. │ │ IRC: classic IRC networks with DM/channel routing and pairing controls. │ │ Google Chat: Google Workspace Chat app with HTTP webhook. │ │ Slack: supported(Socket Mode). │ │ Signal: signal-cli linked device;moresetup(David Reagans:Hop on Discord.). │ │ iMessage: this is still a workinprogress. │ │ LINE: LINE Messaging API webhook bot. │ │ Feishu: 飞书/Lark enterprise messaging. │ │ Nostr: Decentralized protocol;encrypted DMs via NIP-04. │ │ Microsoft Teams: Bot Framework;enterprise support. │ │ Mattermost: self-hosted Slack-style chat;installthe plugin to enable. │ │ Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots. │ │ Matrix:openprotocol;installthe plugin to enable. │ │ BlueBubbles: iMessage via the BlueBubbles mac app REST API. │ │ Zalo: Vietnam-focused messaging platform with Bot API. │ │ Zalo Personal: Zalo personal account via QR code login. │ │ Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities. │ │ Tlon: decentralized messaging on Urbit;installthe plugin to enable. │ │ │ ├───────────────────────────────────────────────────────────────────────────────────────────╯ │ ◇ Select a channel │ Feishu/Lark(飞书)│ ◇ Feishu already configured. Whatdoyou want to do? │ Skip(leave as-is)│ ◇ Select a channel │ Finished Config overwrite: /home/cobrew/.openclaw/openclaw.json(sha256 3cc26d0b17d542823f6e4de4b9db560b1c8dc384214 -41694ced5740b6ed5df266cbbfbc014407f89a82a53c,backup/home/cobrew/.openclaw/openclaw.json.bak)Updated ~/.openclaw/openclaw.json Workspace OK: ~/.openclaw/workspace-code_age Sessions OK: ~/.openclaw/agents/code_agent/sessions │ └ Agentcode_agentready. cobrewDESKTOP-9449JCG:~$web-UI可以看到新的agent手动修改 agents 信息给每个 agent 单独配置这边和一个 agent 的配置大不相同参照下方修改配置每个模型设置单独的 id、名称、 模型、工作目录anget 目录{agents:{list:[{id:main,name:main,model:moonshot/kimi-k2.5,workspace:/home/cobrew/.openclaw/workspace,agentDir:/home/cobrew/.openclaw/agents/main/agent},{id:finance_agent,name:finance_agent,workspace:/home/cobrew/.openclaw/workspace-finance_agent,agentDir:/home/cobrew/.openclaw/agents/finance_agent/agent,model:xiaomi/mimo-v2-flash},{id:code_agent,name:code_agent,workspace:/home/cobrew/.openclaw/workspace-code_age,agentDir:/home/cobrew/.openclaw/agents/code_agent/agent,model:zai/glm-4.7-flashx,identity:{name:全栈开发专家}}]}}为每个 Agent 配置不同的飞书机器人这边要在同一个飞书后台创建 3 个单独的应用将每个应用的appId、appSecret 单独配置。这个目前手动修改配置文件 openclaw.json 比较快保存后会自动重新加载配置。配置如下{channels:{feishu:{enabled:true,connectionMode:websocket,domain:feishu,accounts:{main:{appId:appId,appSecret:appSecret,requireMention:true,groupPolicy:open},code_agent:{appId:appId,appSecret:appSecret,requireMention:false,groupPolicy:open},finance_agent:{appSecret:appSecret,appId:appId,requireMention:true,groupPolicy:open}}}}}参数名称说明requireMentiontrue: 机器人只响应被 的消息群里普通发言不会触发 ;false: 机器人无需被 群里所有消息都会尝试响应accounts.agentId agentId要和agents 中配置的 ID 对应绑定 Agent 到 Channel使用命令绑定# 绑定 agent 到指定飞书账号openclaw agentsbind--agentagentId--bindfeishu:accountId# 示例openclaw agentsbind--agentmain--bindfeishu:main openclaw agentsbind--agentcode_agent--bindfeishu:code_agent openclaw agentsbind--agentfinance_agent--bindfeishu:finance_agent# 查看绑定结果openclaw agents bindings直接改配置文件{bindings:[{type:route,agentId:main,match:{channel:feishu,accountId:main}},{type:route,agentId:finance_agent,match:{channel:feishu,accountId:finance_agent}},{type:route,agentId:code_agent,match:{channel:feishu,accountId:code_agent}}]}# 重启openclaw新版openclaw会自己重启重新加载配置文件openclaw gateway restart# 测试# 为每个机器人配对授权openclaw pairing approve feishu XXXX机器人群聊配置创建群聊的步骤1、在飞书客户端创建群组2、将机器人添加入群3、群聊测试有的是要机器人才能对话有的不需要群聊测试为agents 安装 skills既然是多 agents那么每个 agents 需要的 skills 也是不同的方式一通过clawhub 安装核心是添加–dir 参数指向 agent 自己的 skills 安装目录# code_agentclawhubinstallSelf-Improving--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstallskill-scanner--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstallskill-vetter--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstalltavily-search-1-0-0--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstallbrave-api-search--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstallqmd--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstall--dir/home/cobrew/.openclaw/workspace-code_age/skills clawhubinstall--dir/home/cobrew/.openclaw/workspace-code_age/skills# finance_agentclawhubinstallSelf-Improving--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallskill-scanner--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstalltavily-search-1-0-0--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallstock-screener-cn--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallfundamental-stock-analysis--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallchina-stock-analysis--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallskill-vetter--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallbrave-api-search--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstallqmd--dir/home/cobrew/.openclaw/workspace-finance_agent/skills clawhubinstall--dir/home/cobrew/.openclaw/workspace-finance_agent/skills#clawhub install stock-analysis --dir /home/cobrew/.openclaw/workspace-finance_agent/skills方式二让 agent 自己安装疑难杂症问题 1新配置的飞书机器人无法对话现象新配置的 agent 机器人和飞书能建立长链接配置没有报错但是和机器人对话机器人没有反应原因没有配置机器人事件。添加事件接受消息然后发布版本再测试问题 2agent 使用模型和配置的不匹配我明明使用的是zai/glm-4.7-flashx但是却调用了 kimi-k2.5解决办法直接让小龙虾代劳常用命令# 查看所有可用模型openclaw models list# 查看特定提供商模型openclaw models list--providerdeepseek openclaw models list--provideranthropic openclaw models list--provideropenai# 查看 Agent 详情含当前模型openclaw agents describe main openclaw agents describe coding# 查看实时日志openclaw logs--follow# 查看配对列表用于私聊授权openclaw pairing list feishu openclaw pairing approve feishuCODE

相关新闻