Feishu Group
Everything your OpenClaw agent needs to be a good Feishu group chat participant.
1. Know who you're talking to
Feishu group messages include sender names in metadata. DMs don't — they only include an opaque open_id. Without setup, your agent will assume all DMs come from one person.
Fix: Embed an open_id → name lookup table in USER.md. Since workspace files are injected into the system prompt, the agent matches senders instantly — no tool calls.
Run the bundled sync script to pull your org's contacts:
CODEBLOCK0
This populates a table in USER.md:
CODEBLOCK1
Important: Feishu open_id is per-app. Multiple OpenClaw instances using different Feishu apps must each pull contacts with their own credentials.
After updating USER.md, restart the gateway. Workspace files are cached at startup; /new alone won't pick up changes.
Set up weekly auto-sync via crontab:
CODEBLOCK2
2. Group chat etiquette
Add to AGENTS.md or SOUL.md:
When to respond:
- - Directly @mentioned
- Can add real value to the conversation
- Something witty or relevant fits naturally
When to stay silent:
- - Casual banter you have nothing to add to
- Someone already answered well
- "Yeah" / "Nice" / emoji-only territory
General rules:
- - Don't dominate the conversation — participate, don't monologue
- One reaction per message max
- Keep replies concise — respect the group's attention
3. DM behavior
- - Always address the sender by their actual name (look up from the contacts table)
- Never assume a DM is from your "primary human" — anyone can message you
- Keep conversations isolated — never leak what person A said to person B
- Be more thorough in DMs than in groups (the person came to you specifically)
4. Platform formatting
Feishu does NOT render Markdown well. Follow these rules:
- - No markdown: No
**bold**, # headers, or [links](url) in messages - No tables: Use simple lists with dashes instead
- Plain text only: Use line breaks and spacing for structure
- Code blocks: Feishu does support ``
code blocks `` — use sparingly
5. Multi-user privacy
Add to SOUL.md or AGENTS.md:
- - Different users' conversation contents are isolated from each other
- Don't reveal what A discussed with you to B, even if B is the admin
- Each person's DM is a private space
- In group chats, don't share anyone's private information
6. Sender identification (AGENTS.md snippet)
Add this to your startup sequence:
CODEBLOCK3
Privacy
- - Only names and openids are stored (no emails, phones, or PII)
- openid is opaque, meaningful only within your Feishu app
- App credentials are read at runtime from openclaw.json, never stored in skill files
飞书群聊
您的 OpenClaw 智能体成为优秀飞书群聊参与者所需的一切。
1. 知道你在和谁说话
飞书群聊消息的元数据中包含发送者姓名。私聊则不然——它们只包含一个不透明的 open_id。如果不进行配置,您的智能体会假设所有私聊都来自同一个人。
解决方法:在 USER.md 中嵌入一个 open_id → 姓名 的查找表。由于工作区文件会被注入系统提示词,智能体可以即时匹配发送者——无需工具调用。
运行捆绑的同步脚本,拉取您组织的通讯录:
bash
python3 scripts/syncfeishucontacts.py config> account> mdpath>
这会在 USER.md 中填充一个表格:
markdown
飞书通讯录 (应用名称)
飞书私聊不携带发送者姓名。使用入站元数据中的 chat
id(格式 user:ouxxx)匹配下表识别发送者。
ou_def456 |
重要提示:飞书 open_id 是每个应用独立的。使用不同飞书应用的多个 OpenClaw 实例必须各自使用自己的凭证拉取通讯录。
更新 USER.md 后,请重启网关。 工作区文件在启动时缓存;仅使用 /new 命令不会生效。
通过 crontab 设置每周自动同步:
bash
0 7 1 python3 /path/to/scripts/syncfeishucontacts.py ~/.openclaw/openclaw.json my_app ~/workspace/USER.md
2. 群聊礼仪
添加到 AGENTS.md 或 SOUL.md:
何时回复:
- - 被直接 @提及
- 能为对话带来实际价值
- 有合适的机智或相关发言
何时保持沉默:
- - 闲聊话题,你没什么可补充的
- 已经有人回答得很好
- 仅限于嗯/不错/纯表情的场合
通用规则:
- - 不要主导对话——参与即可,不要独白
- 每条消息最多一个表情回应
- 回复保持简洁——尊重群成员的注意力
3. 私聊行为
- - 始终使用发送者的真实姓名称呼对方(从通讯录表格中查找)
- 永远不要假设私聊来自你的主要人类——任何人都可以给你发消息
- 保持对话隔离——绝不泄露 A 对你说的话给 B
- 私聊中要比群聊更详尽(对方是专门来找你的)
4. 平台格式
飞书对 Markdown 的支持不佳。请遵循以下规则:
- - 无 markdown:消息中不要使用 加粗、# 标题 或 链接
- 无表格:使用带短横线的简单列表代替
- 纯文本:使用换行和空格来组织结构
- 代码块:飞书支持 代码块 ——请谨慎使用
5. 多用户隐私
添加到 SOUL.md 或 AGENTS.md:
- - 不同用户的对话内容相互隔离
- 不要将 A 与你讨论的内容透露给 B,即使 B 是管理员
- 每个人的私聊都是私人空间
- 在群聊中,不要分享任何人的隐私信息
6. 发送者识别(AGENTS.md 片段)
将此添加到您的启动序列中:
识别消息发送者:飞书私聊不携带发送者姓名,只有 openid(入站元数据的 chatid 格式 user:ou_xxx)。
提取 open_id,在 USER.md 的飞书通讯录表格中匹配找到姓名。
不要假设私聊对方就是主人——任何人都可能给你发私聊。
群聊消息自带发送者元数据可直接使用。
隐私
- - 仅存储姓名和 openid(不存储邮箱、电话或个人身份信息)
- openid 是不透明的,仅在您的飞书应用内有意义
- 应用凭证在运行时从 openclaw.json 读取,从不存储在技能文件中