M7-16 P0 | KnowledgeItem.sourceRef 从未被赋值,material scope 检索失效 #104
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?
发现
代码审查 Batch 2 发现
sourceRef字段在整个代码库中只有一处使用:但
sourceRef从未在任何地方被赋值:KnowledgeItemsRepository.create()— 不传 sourceRefImportCandidateService.accept()— 不传 sourceRefDocumentImportService— 不传 sourceRef结果:material scope 的 AI 检索永远查不到任何 KnowledgeItem,资料范围的对话实际上用的是空上下文。
影响范围
material类型会话的 AI 回答无法检索到资料内容knowledge_base和knowledge_itemscope 不受影响修复方案
KnowledgeItemsRepository.create()增加sourceRef参数ImportCandidateService.accept()传入 candidate 的 sourceId 作为 sourceRef涉及文件
修复
涉及: knowledge-items.repository.ts + import-candidate.service.ts