Repository navigation
fix: pick upstream compaction fixes #1984, #1988, #1994 - #63
Merged
Merged
Conversation
Cherry-picked from upstream PI-Desktop vastsa#1984 (ec77831). The folded tail is summarized too, but its Read/Write/Edit paths were not recorded, so the checkpoint's read/modified file lists missed them. (cherry picked from commit ec77831) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry-picked from upstream PI-Desktop vastsa#1988 (e8f315d). Chunk planning reserved the carried summary at four characters per token while the guard measures 3.5, so a first chunk could exceed its window. (cherry picked from commit e8f315d) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry-picked from upstream PI-Desktop vastsa#1994 (4eea56e). A Responses gateway can leave cached input out of total_tokens, so the compaction budget was anchored too low and a turn could be sent without the expected checkpoint. The runtime now uses the inspector's occupancy calculation, taking the larger of the bucket sum and the reported total. (cherry picked from commit 4eea56e7f5d0ef2eeaf30bf1bd1d0bcc3c48d5e0) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The upstream file-ops test answers completeSimple, but mc-agent streams summaries since #55, so the fixture now answers streamSimple. The context-usage fixture now sees the R21.2 post-compaction re-read and records it as "restore", separate from the model's own tool call. Records the pick in the docs so the next full sync knows these three fixes are already in. 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.
改动
从上游 PI-Desktop 单独挑入三个压缩修复,不是整体同步。fork 里原本没有这三处,和 #55、#59–#61 修的内容也不重叠。
total_tokens不含缓存命中的输入,runtime 因此把用量算小,接近上限时也不压缩,下一轮可能直接超窗。现在和检查器用同一套算法:分项加总与上报的总数取较大值。<read-files>/<modified-files>。三个都用
cherry-pick -x -m 1挑入,没有冲突;提交说明里写了上游 PR 编号和原提交号。为适配 mc-agent 改的地方(单独一个提交):
completeSimple打桩,而 fork 从 fix: harden compaction, questions and session lifecycle #55 起摘要改走streamSimple,这里改成streamSimple打桩。restore,和模型自己的工具调用区分开。更新说明(用户可见)
刻意未改
上游其余 230 多个提交本次不同步。README 的上游同步记录里写明了这次只挑入的三处,下次整体同步时应和上游保持一致。
验证
context-usage19 项通过。pnpm lint、git diff --check、文档检查(645 页)通过。scripts/e2e-context-usage-compaction.mjs需要先构建 sidecar,本地没跑。🤖 Generated with Claude Code