飞书渠道只支持被动回复——用户先发消息,agent 才能回复。当 agent 需要主动发起对话(如 Agent A 派任务给 Agent B,Agent B 需要在自己的飞书窗口回复用户),飞书渠道没有这个能力。本 skill 通过直接调用飞书 OpenAPI 发送文本消息,补齐主动投递能力。
The Feishu channel only supports passive replies — the user must send a message first before the agent can respond. When an agent needs to proactively initiate a conversation (e.g. Agent A dispatches a task to Agent B, and Agent B needs to reply in its own Feishu chat window), the channel lacks this capability. This skill fills that gap by calling Feishu OpenAPI to send text messages directly.
python3 scripts/feishu_proactive_messenger.py --agent <agent_id> --text "Mission accomplished"
--agent 指定当前 agent 的 id(如 coder、data、life),脚本会自动读取对应的飞书凭证和 defaultTo 目标用户。若省略 --agent,则通过 cwd 自动匹配。
--agent specifies the current agent's id (e.g. coder, data, life). The script reads the corresponding Feishu credentials and defaultTo target automatically. If --agent is omitted, the script resolves the agent by matching cwd.
python3 scripts/feishu_proactive_messenger.py \
--agent <agent_id> \
--text "要发送的消息内容" \
--receive-id <chat_id|open_id> \
--receive-id-type <chat_id|open_id|user_id>
--agent(推荐):agent id(如 coder、data、main)。用于确定使用哪个飞书应用的凭证。若省略,通过 cwd 自动匹配(在被派发任务场景下可能不准确,建议显式指定)。--text(必填):要发送的消息文本。--receive-id(可选):目标 chat_id 或 open_id。若省略,依次从环境变量 OPENCLAW_CHAT_ID / OPENCLAW_RECEIVE_ID / FEISHU_CHAT_ID 或 account 的
defaultTo 配置中读取。
--receive-id-type(可选):若省略,根据前缀自动识别:oc_ → chat_idou_ → open_idon_ → user_id--agent (recommended): Agent id (e.g. coder, data, main). Determines which Feishu app credentials to use. If omitted, resolves by matching cwd (may be inaccurate in dispatched-task scenarios; explicit is recommended).--text (required): The message text to send.--receive-id (optional): Target chat_id or open_id. If omitted, reads from env OPENCLAW_CHAT_ID / OPENCLAW_RECEIVE_ID / FEISHU_CHAT_ID, or from
the account's defaultTo config.
--receive-id-type (optional): If omitted, auto-detect by prefix:oc_ → chat_idou_ → open_idon_ → user_id--agent 参数或 cwd 匹配确定当前 agent id。~/.openclaw/openclaw.json 读取对应 account 的 appId/appSecret。defaultTo 读取默认目标用户(如未通过参数指定)。bot/v3/info API 获取 bot 显示名称。im/v1/messages)发送文本消息。✅ [Bot名称] 消息已发送。--agent parameter or by matching cwd.~/.openclaw/openclaw.json based on the agent id.defaultTo (if not specified via args).bot/v3/info API.im/v1/messages) to deliver the text message.✅ [BotName] 消息已发送.每个飞书 account 需要配置 defaultTo,指向目标用户的 open_id:
Each Feishu account needs a defaultTo pointing to the target user's open_id:
openclaw config set channels.feishu.accounts.<account>.defaultTo "user:ou_xxx"
注意:飞书的 open_id 是按应用隔离的,同一个用户在不同 bot 下有不同的 open_id。
Note: Feishu open_id is app-scoped — the same user has different open_ids under different bots.
channels.feishu.accounts 存在于 ~/.openclaw/openclaw.json,且 bindings 映射 agentId → accountId。
--receive-id,设置 OPENCLAW_CHAT_ID, 或配置 defaultTo。
log_id 进行排查。channels.feishu.accounts exists in ~/.openclaw/openclaw.json and bindings map agentId → accountId.
the bot at least once.
--receive-id, set OPENCLAW_CHAT_ID, or configure defaultTo.
log_id in Feishu error payload.本技能从 ~/.openclaw/openclaw.json 读取飞书凭证:
channels.feishu.accounts.*.appIdchannels.feishu.accounts.*.appSecret凭证仅用于获取 tenant access token 并发送消息。技能不会存储或向其他地方传输凭证。
This skill reads Feishu credentials from ~/.openclaw/openclaw.json:
channels.feishu.accounts.*.appIdchannels.feishu.accounts.*.appSecretThese values are used only to obtain a tenant access token and send the message.
The skill does not store or transmit credentials anywhere else.
--agent 参数或工作区匹配选择正确的飞书应用凭证。defaultTo 使用时,agent 无需知道任何 ID 即可主动发消息。feishu-file-sender 互补:一个发文件,一个发文本。--agent parameter or workspace matching to choose credentials.defaultTo, agents can send messages without knowing any IDs.feishu-file-sender: one sends files, the other sends text.scripts/feishu_proactive_messenger.py--agent 参数,显式指定 agent 身份(解决被派发任务时 cwd 匹配不准确的问题)bot/v3/info API 获取 bot 显示名称✅ [Bot名称] 消息已发送,不再暴露 open_id 等敏感信息resolve_agent_id 支持 agents.defaults.workspace 作为 fallback共 1 个版本