#cron failed

1 messages · Page 1 of 1 (latest)

south blaze
#

02:13:47 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool start: runId=ce8350f2-e906-432e-8efc-4576dde7b3e6 tool=message toolCallId=call_149b30b3f1754269872ce039
02:13:47 debug agent/embedded {"subsystem":"agent/embedded"} Tracking pending messaging text: tool=message len=27
02:13:47 error [tools] message failed: Unknown target "chat" for Feishu. Hint: <chatId|user:openId|chat:chatId>
02:13:47 error [tools] message failed: Unknown target "chat" for Feishu. Hint: <chatId|user:openId|chat:chatId>
02:13:47 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool end: runId=ce8350f2-e906-432e-8efc-4576dde7b3e6 tool=message toolCallId=call_149b30b3f1754269872ce039
02:14:04 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool start: runId=ce8350f2-e906-432e-8efc-4576dde7b3e6 tool=message toolCallId=call_fd326d7a403442979f1b3703
02:14:04 debug agent/embedded {"subsystem":"agent/embedded"} Tracking pending messaging text: tool=message len=27
02:14:04 error [tools] message failed: Action send requires a target.
02:14:04 error [tools] message failed: Action send requires a target.
02:14:04 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool end: runId=ce8350f2-e906-432e-8efc-4576dde7b3e6 tool=message toolCallId=call_fd326d7a403442979f1b3703

问题在哪,怎么解决

timber muralBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

fiery parrot
#

True

south blaze
#

“⚠️ ✉️ Message failed” was sent to group chat

urban sigilBOT
#

从这两行报错就能看出来,问题不在 Feishu 连接本身,而在 message 工具的参数

  1. Unknown target "chat" for Feishu
    你把 target 传成了字符串 "chat"(只有类型名,没有具体 ID),Feishu 不认识这种目标。

Feishu 的 target 需要是下面这种格式之一(日志里也给了 Hint):

  • 群/会话chat:<chat_id>(例如 chat:oc_xxx
  • 私聊用户user:<open_id>(例如 user:ou_xxx
  1. Action send requires a target.
    第二次调用直接 没传 target,所以被工具层拒绝了。

怎么改(最直接)

把你 cron/agent 里调用 message 的参数改成带真实 ID 的 target,例如:

#
{
action: "send",
channel: "feishu",
target: "chat:oc_xxx", // 群聊/会话 chat_id
message: "..."
}

或私聊:

{
action: "send",
channel: "feishu",
target: "user:ou_xxx", // 用户 open_id
#
message: "..."
}

另外:如果你只有 oc_... 这种 chat_id,建议总是加前缀 chat:(群)或 dm:(私聊)来避免歧义。


chat_id / open_id 去哪拿?

最简单的方法:让机器人在目标群/私聊里先收到一条消息,然后看 gateway 日志里的上下文,通常会出现类似:

  • From: feishu:group:oc_xxx(群)
  • From: feishu:ou_xxx(私聊用户)

把里面的 oc_xxx / ou_xxx 拿来用,再分别加上 chat: / user: 前缀。


#

如果你愿意,把你触发这次发送的 cron 配置/agent 提示词里那段“让它发消息”的部分贴一下(打码 secret),我可以帮你指出到底是哪一行把 target 写成了 "chat" 或漏传了。

#

对的(True 👍)。这段日志的“根因”就是:message 工具被调用时,target 参数写错/缺失

  • 第一次:target: "chat"(只有类型名,没有具体 id)→ Unknown target "chat" for Feishu
  • 第二次:干脆没传 targetAction send requires a target

解决办法

把发送工具调用改成带真实 ID 的 target:

  • 发到飞书群/会话(chat_id,一般长这样:oc_...):

  • target: "chat:oc_xxx"(或 group:oc_xxx

  • 私聊某个用户(open_id,长这样:ou_...):

  • target: "user:ou_xxx"

示例(关键是 target):

#
{ action: "send", channel: "feishu", target: "chat:oc_xxx", message: "..." }

你可能踩的点(cron 场景常见)

如果这是 cron/定时任务 触发的:没有“当前会话”可用,所以不能省略 target(省略只适用于“在飞书对话里直接回复当前聊天”的场景)。

下一步我需要你补一条信息

你现在是在哪里配置/触发这个发送的?(二选一就行)

  1. 你的 cron 配置里那段“发送消息”的片段(打码 secret)
  2. 你的 agent 提示词里要求它“发到 chat”的那句

贴出来我就能告诉你应该把哪一行从 "chat" 改成 "chat:oc_xxx" / "user:ou_xxx"

#

“⚠️ ✉️ Message failed” 那条就是 OpenClaw 把这次 message 工具调用失败的错误回抛/通知出来了(不然你只在日志里看到,聊天里不知道为什么没发出去)。把发送参数修好,它自然就不会再发失败通知。

你的问题点仍然是同一个:

  • 你调用 messageFeishu 时,把 target 写成了 "chat"(占位符),所以报:
  • Unknown target "chat" for Feishu
  • 然后又重试了一次,但这次 没带 target,所以报:
  • Action send requires a target

正确写法(Feishu)

target 必须是具体 ID,而不是 “chat” 这种类型名:

  • 群/会话:target: "chat:<chat_id>"(一般是 oc_...
  • 私聊用户:target: "user:<open_id>"(一般是 ou_...

例子: