Repository navigation
Conversation
使用整串小写 shadow 索引和区分大小写的 trigram,短词在规范化正文上精确匹配。 摘录携带完整正文产生的 UTF-16 高亮范围,保留大小写上下文、空白压缩与多字节位置;补充检索、点击定位和安全渲染回归。
GPT-6 Astra 自动代码审查审查提交: 由 Codex 定时任务使用 GPT-6 Astra 子 agent 审查,并经主 agent 复核。 [P2] 空列表清理前需区分扫描失败与真实无会话位置:src/hooks/useSessionContentSearch.ts:107 当用户仅有一个提供商的会话,且其会话目录临时无法读取(例如权限暂时丢失),并且故障持续到后台二次扫描时,本次取消 hasSessions 检查会把原本保留的正文索引全部清空。后端扫描器将 read_dir 等错误吞掉并返回空列表,list_sessions 仍返回 Ok([]),所以这里的 listIsSuccess 为 true、listUpdatedAt 非零,不能阻止同步。run_sync 随后以空 seen 调用 retain_sources,删除所有缓存正文和指纹;目录恢复后必须全量重建,期间正文结果缺失并产生不必要的解析和写盘开销。原始会话文件不会被删除。base 在该全空场景跳过同步,因此这是本次扩展空列表同步引入的回归,而非仅报告既有的部分扫描失败问题。 证据:
建议:在扫描结果中传递错误或完整性状态,并让后台仅对确认扫描成功的提供商执行破坏性的 retain_sources 清理;真实成功的空扫描仍应清理。增加“已有索引 + 唯一会话目录暂时不可读 + 返回空列表 + 恢复读取”的回归测试,断言失败期间保留旧索引和指纹。 验证与范围完整覆盖 13 文件差异及搜索、索引、设置、阅读器和扫描上下文,确认一项 P2。主 agent 复核了取消 hasSessions 防护、list_sessions 返回 Ok([])、扫描器吞掉目录读取错误,以及 retain_sources 空集合删除路径;影响为缓存索引误清,不是原始会话文件丢失。
未验证或受限范围:
本评论仅针对以上提交的代码审查结果,不构成合并批准。 |
- 按提供商记录扫描完整性,仅清理确认扫描成功的源 - 保留读取失败时的正文和指纹,恢复后正常增量同步 - 覆盖目录故障、独立清理、数据库恢复和 UTF-8 尾部读取
验证:
本次修订由 AI 辅助完成。前端未改动,本次未重跑前端检查;Windows/macOS、原有 9 项忽略测试和原生桌面 E2E 未在新提交上验证。原先的跨平台 QA 只覆盖 |
11f39a5
into
farion1231:feat/session-content-search
Scope
This is a follow-up to #7896, targeting its
feat/session-content-searchbranch at078031d37d16320961230e66d0b366470fa1782c. It contains five focused fix commits, not another implementation of the whole feature. Related investigation: #7896 (comment).Fixes
Index migration and storage
The disposable local search index schema moves from version 1 to 2. Existing v1 indexes are rebuilt through the existing cache-rebuild mechanism; original session files are unchanged. Version 2 retains original text and adds a lowercase shadow, so local index storage grows. Search remains within the Text-only scope of #7896; this does not add tool-output indexing or reader projection changes.
Validation
Verified in an isolated Linux worktree against this exact five-commit branch:
git diff --check: passed.Not run in the original Linux validation: the 9 ignored Rust tests, native desktop/UI E2E, or Windows/macOS builds. Windows/macOS checks were subsequently completed below. The renderer build has the existing large-chunk warning. GitHub CI status should be checked separately on the PR head.
Checklist
AI-assisted contribution, with locally executed regression tests and explicit validation limits above. Kept as a draft for review of the dependent changes.
Isolated fork QA: passed
Run: https://github.com/xue-ding-e/cc-switch/actions/runs/38150771788
The PR targets a feature branch, while the existing upstream CI only triggers for main. An isolated QA branch therefore ran frontend checks and the existing Linux/Windows/macOS backend checks without modifying this PR or main. QA commit
1200ed6db03f6462236f0e0095cd9ed17619e7a6adds only.github/workflows/qa7896.yml; every product/source file is identical to PR head4d3c86890feb7bf1e443066166429438387c472b.All four jobs and the workflow completed successfully. These are fork QA results for the identical code snapshot, not upstream required checks on the PR SHA. Native desktop/UI E2E and ignored tests remain unverified. The QA workflow uses read-only permissions, no secrets or release steps, and does not persist checkout credentials.