-
-
Notifications
You must be signed in to change notification settings - Fork 69k
Feishu 话题群流式回复创建新话题问题 #28273
Copy link
Copy link
Closed
newtontech/openclaw-fork
#14Description
Feishu 话题群流式回复创建新话题问题
问题描述
在飞书话题群中,当 Agent 使用流式卡片(streaming card)回复消息时,会创建一个新的话题,而不是在原话题下回复。
问题复现
- 在飞书话题群创建一个话题(Topic A)
- 在 Topic A 中 @机器人 发送消息
- Agent 回复:
- ✅ 第一条普通消息在 Topic A 下(正确)
- ❌ 第二条流式卡片消息创建新话题(错误)
问题根因
代码链路
bot.ts (有 rootId)
↓ 未传递
reply-dispatcher.ts (缺少 rootId 参数)
↓ 未传递
streaming-card.ts (创建消息时无 root_id)
↓
飞书 API (创建新话题)
关键代码
streaming-card.ts - 创建消息时缺少 root_id:
const sendRes = await this.client.im.message.create({
params: { receive_id_type: receiveIdType },
data: {
receive_id: receiveId,
msg_type: "interactive",
content: JSON.stringify({ type: "card", data: { card_id: cardId } }),
// ❌ 缺少 root_id 参数
},
});飞书消息结构
飞书话题群的消息结构:
话题根消息: root_id = null
└── 话题回复: root_id = <根消息ID> ← 必须传递!
日志证据
10:23:41 话题隔离启用: topic session isolation enabled
10:25:33 发送 2 条回复
10:25:36 流式卡片创建(messageId=om_x100b55...)
↑ 没有关联到原话题的 root_id
影响范围
- ✅ 不影响普通消息回复(已正确使用
replyToMessageId) - ✅ 只影响流式卡片回复
- ✅ 不影响
topicSessionMode配置(已正常工作)
解决方案
已创建修复 PR: #XXX
修改 3 个文件,添加 rootId 参数传递:
streaming-card.ts- 在start()方法添加rootId参数reply-dispatcher.ts- 在CreateFeishuReplyDispatcherParams类型添加rootIdbot.ts- 传递ctx.rootId到createFeishuReplyDispatcher()
临时解决方案
在修复合并前,可以禁用流式回复:
{
"channels": {
"feishu": {
"streaming": false
}
}
}环境信息
- OpenClaw 版本:2026.2.25
- 飞书群类型:话题群
- 配置:
topicSessionMode: "enabled"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.