M7-04 P1 | ChatMessage 新增 scopeSnapshot 快照字段 #73
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
消息创建时记录当时的 scope,避免知识库变动后消息失去上下文。
Schema 变更
填充规则
每次 sendMessage/sendMessageStream 时,从 session 读取 scopeType/scopeId/sourceIds 写入 scopeSnapshot。
完成情况
交付物
ChatMessage 新增字段 (
prisma/schema.prisma):数据结构
用途
Service 层
buildScopeSnapshot(session)方法从会话提取 scope 信息sendMessage/sendMessageStream在创建用户消息和 AI 消息时均写入 scopeSnapshot涉及文件