Skip to content

fix(knowledge): 修复目录重扫断线与 PDF 预览,整合桌面交互和启动恢复 - #89

Merged
Soren-ABT merged 5 commits into
mainfrom
fix/knowledge-beta-rescan-preview
Nov 24, 2026
Merged

Soren-ABT merged 5 commits into
mainfrom
fix/knowledge-beta-rescan-preview

Conversation

@Soren-ABT

Copy link
Copy Markdown
Owner

修复范围

基于 v0.6.0-beta.1 对应的 main,完整包含 #87 的 4a4bf06 和 #88 的 3fe3c38,并保留原始提交与作者。

  • 已绑定目录的重扫先返回任务编号,再查询已处理条目、最近路径和最终结果。来源按钮、行菜单和批量操作使用同一流程。重开面板可接回正在进行的任务,并发请求按来源合并,部分失败会显示错误。
  • 新上传、目录导入和历史 PDF 都能处理缺失、空串和通用 MIME。旧宿主返回通用字节时,面板核对 PDF 标识后打开内置阅读器,旧库可直接预览。
  • 桌面面板标题栏显式设为 no-drag,保留窗口拖动带。Escape 逐层关闭弹层,面板关闭后焦点回到入口。
  • 启动恢复复用同一份分块计数,保留已完成空文档的状态。全局 autoRetrieveCitation 默认开启,关闭引用要求后仍注入证据、来源和不可信内容提示。

既有同步 /reindex 调用契约兼容。完成摘要新增可选任务编号,历史记录可直接读取,包版本仍为 0.6.0-beta.1。

验证

  • DSH 0.2.2-rc.5 下通过 736 项测试、类型检查、构建、检索基准、工作区和包校验。生产依赖审计为 0 个 high、0 个 critical。
  • 官方 Windows Web profile 实扫 1,000 份 Markdown。点击到取得编号为 30 ms。主动中断一次进度查询并重开面板,找回同一任务,约 53 秒完成,新建 1,000、失败 0。单独运行 RC.5 的转发函数,在延迟响应头的对照实验中于 305.8 秒得到 UND_ERR_HEADERS_TIMEOUT。
  • 浏览器内嵌 PDF 实际显示第 1 页和正文,自动下载事件为 0。全局引用开关经面板保存后,由独立 HTTP 读取确认。
  • RC.5 窗口命中测试中,关闭按钮被当作拖动区的像素行从窗口模式的 27/30、全屏时的 30/30 均降至 0/30。完整候选包的原生 macOS Electron 交互尚待复测。
  • 对 125,000 个分块和 4,087 篇合成文档交替测量六轮,启动恢复相关 SQLite 查询耗时中位数由 2,107 ms 降至 156 ms。

Fixes #84
Fixes #85
Fixes #86
Refs #83

kakashiii-ex and others added 5 commits November 23, 2026 16:25
…figurable (#85, #86)

Directory imports published documents without a mimeType, so the raw route served every PDF as application/octet-stream and the panel iframe fell back to a download. Derive the MIME from the extension on upload/path imports, fall back to the file name in getRawFile and the raw response, and keep existing libraries previewable without a reindex.

Also add a global autoRetrieveCitation switch (default true): off keeps the injected evidence and untrusted-content boundary but drops the instruction that makes the model print source labels. Exposed in the global defaults scope of the retrieval settings.
The raw-preview spec copied an older inline FakeTable that lacks the deleteMany method required by the DSH 0.2.2-rc.5 KvTable interface, so every typecheck job failed before running tests. Use tests/helpers/memory-kv-table.ts instead.
Track bound directory scans across browser disconnects and panel reopening. Honor generic MIME data from older PDF uploads, and keep window controls clickable in the desktop host. Add regression coverage for each path.
@Soren-ABT
Soren-ABT merged commit e7e291e into main Nov 24, 2026
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants