M7-13 P0 | loadContextByScope: global 走全库检索 + folder 无独立分支 #101
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?
发现位置
rag-chat.service.tsL333-381loadContextByScope方法。问题 1: global scope 错误检索知识库
globalscope 的正确行为是不检索任何知识库内容(纯模型回答),但现在走了default分支,如果 kbId 不为 null,会错误检索整个知识库。问题 2: folder scope 无独立检索逻辑
folderscope 在VALID_SCOPE_TYPES中已定义,但loadContextByScope没有case 'folder'。走了default分支后用了全库检索,而非只检索该 folder 及其子节点的内容。修复方案
case 'global':→ 返回空上下文{ text: '', citations: [], isEmpty: true }case 'folder':→ 先查 folder 的KnowledgeItem(itemType=folder),获取其下所有子 item,再按 item IDs 检索parentId = scopeId的所有 itemdefault分支改为 fallback 到 knowledge_base 行为 + warn 日志涉及文件
修复
涉及: rag-chat.service.ts