Repository navigation
feat: restore recent files after compaction and measure summary requests - #61
Merged
Merged
Conversation
R21.2: after a compaction the model lost the file contents it had just read and either re-read them or edited from memory. A summary checkpoint now carries up to five re-read file snapshots (5K tokens each, 8K total) when they fit below the next compaction threshold and still shrink the context. Reads go through the normal tools.execute path with a new internal nonInteractive flag, so a read that would need approval is skipped instead of prompting. Snapshots are stored next to the summary in the checkpoint details, sent in the same user message, and never re-read on rebuild. Zero files is a normal outcome. R21.3: before deciding whether a cache-sharing summary request is worth building, record duration, stop reason and input/output/cache counts for every summary attempt in the local log. The cache trial itself waits for that baseline from installed builds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
实现 R21.2(压缩后附回文件片段,V61)和 R21.3 的测量部分(V62)。
tools.execute新增内部参数nonInteractive。自动判断无法放行时,直接返回APPROVAL_REQUIRED,不创建审批请求;显式允许和拒绝的行为不变。只有 runtime 内部会设置它,模型参数设置不了。tools.execute路径,所以远程路由和路径校验照旧生效。并发 2,总时限 10 秒;Stop 或超时会中止未完成的读取。details.restoredFiles里,和摘要分开存;落盘沿用"先落盘、后安装"的既有顺序。重建只用已存的快照,不重新读文件。session.compaction.summary。服务商没返回用量时标为未知,不当作 0。文件恢复的结果写到session.compaction.restore。两类日志都不含正文和路径。更新说明(用户可见)
刻意未改
验证
APPROVAL_REQUIRED,且不产生审批事件)。cargo fmt --check通过,Clippy 对新代码没有报告警。pnpm lint、桌面mcp-control测试、文档检查都通过。还没验证的:远程工作区下的慢读;真实会话里附回文件的实际收益;各适配器对"同一条消息里两个文本块"的处理(离线只验证了转换出的结构)。
🤖 Generated with Claude Code