[Feature] 插件更新会话解析逻辑后,Core 已缓存的会话不会重扫:缓存按插件解析器版本失效
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 39/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- ai-infra-agents, backend
Research direction
Start by reading the session store under rust/crates/agent-sessions and the Core contract in API-45, then inspect the Codex and Claude Code plugins’ session source declarations or scan responses. Define how parser versions are stored and trigger bounded rescans only for the affected plugin when its version changes. Done means tests cover unchanged versions, plugin-specific invalidation, and resuming a rescan after interruption.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
Agent 会话记录的 Core 缓存(rust/crates/agent-sessions 的 store)按文件的大小和读取位置判断要不要重新扫描,不认插件解析器的版本。插件更新了解析逻辑之后,已经缓存过的会话文件不会重扫,除非文件本身又变了。例如插件开始报告新字段(子代理线程 threads、新的用量字段),或者修正了标题、用量的解析。
影响:用户升级插件后,旧会话在会话页、用量页里还是旧解析的结果,新字段缺失,旧的错误也不会更正;新会话却是新结果,两者混在一起。
现状的绕法:Core-10(会话恢复、导出、子代理明细,Lithe-IDEA/Lithe-core-rust 分支 feat/agent-session-resume)为了让已有缓存带上 threads,把缓存结构版本从 3 升到 4,升级后第一次同步会全部重扫。这只能在 Core 改结构时用一次,插件自己更新时用不上。
Proposed solution / 建议方案
- 插件在会话来源的声明里(或
scan的回答里)给出解析器版本,Core 把它和每个文件的缓存记录存在一起。 - 版本变了,就只把这个插件的会话文件标记为需要重扫,其他插件的缓存不动;重扫照常在后台、有界地进行。
- 契约写明:插件改了解析结果的形状或含义时要升这个版本;只改性能不用升。
- 测试覆盖:版本不变不重扫;版本变了只重扫该插件;重扫中途退出后下次继续。
需要改 Core 契约(API-45,agents 0 内的补充)和 Codex、Claude Code 两个插件。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
AI
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 每次 Core 改动都升缓存结构版本、全量重扫:插件更新时无效,而且会把所有插件的缓存一起清掉,会话多时首次同步很慢。
- 用插件的版本号代替解析器版本:插件改别的地方也会触发全量重扫,代价太大。
Additional context / 补充信息
在 #2654 的 Core-10 工作包验收时发现。相关:#2654。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 3h 13m
- Merged PRs (30d)
- 614
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
enhancement issue-form:feature review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
1lck/Lithe-IDEA#2678 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2565 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement issue-form:feature review: low
Difficulty 5/5 Over a week Newbie friendliness 35/100
1lck/Lithe-IDEA#2677 ·
Maintainers usually reply within 1 day
-
[Bug] Lithe 操作运行期间另一个程序写入的文本,本地历史有时记成用户(TestLocalHistoryTellsAnOperationsWriteFromAnotherPrograms 约 1/4 失败)Possibly taken @WhiteZeek claimed this today. Openarea:editor bug P2 platform:macos review: high
Difficulty 4/5 3-5 days Newbie friendliness 35/100
1lck/Lithe-IDEA#2657 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agilepathway/label-checker#1015 · 2 comments ·
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug P3
Difficulty 1/5 Under an hour Newbie friendliness 89/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
react-component/image#541 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day