fix(hub): 保留飞书回复上下文

This commit is contained in:
2026-07-08 16:03:52 +08:00
parent a025d23af8
commit a00e4f9871
7 changed files with 311 additions and 10 deletions
+9 -3
View File
@@ -24,11 +24,14 @@ interface LarkMessage {
message_id?: string;
msg_type?: string;
content?: string;
body?: { content?: string };
create_time?: string;
sender?: { id?: string; sender_type?: string };
chat_id?: string;
parent_id?: string;
parent_message_id?: string;
root_id?: string;
thread_id?: string;
}
interface ImV1Message {
@@ -84,14 +87,17 @@ export async function readFeishuContext(
/** Project a lark message down to the fields the model actually needs. */
function compact(m: LarkMessage): Record<string, unknown> {
const parentId = m.parent_id ?? m.parent_message_id;
return {
message_id: m.message_id,
msg_type: m.msg_type,
content: m.content,
content: m.body?.content ?? m.content,
create_time: m.create_time,
chat_id: m.chat_id,
sender_id: m.sender?.id,
parent_message_id: m.parent_message_id,
parent_id: parentId,
parent_message_id: parentId,
root_id: m.root_id,
thread_id: m.thread_id,
};
}