Repository navigation
fix(agent-runtime): fit compaction summaries to the output budget - #59
Merged
Merged
Conversation
The handoff prompt asked for 4K-8K tokens regardless of the request's output limit. On models capped near 8K, with reasoning sharing that budget, summaries hit the limit; a truncated summary is rejected and is not a transient error, so every compaction failed and auto compaction fell back to dropping the whole older history. Scale the length target to 40% of the generation budget (capped at 8K), give split-turn prefix summaries their own 2K target, and retry a truncated summary once with a halved target and the lowest supported reasoning before failing. The prompt now quotes still-applicable user constraints, approvals and corrections verbatim instead of paraphrasing them, while completed requests and pasted material stay condensed. Also restart the progress attempt count for each summary request, so a split turn's prefix retry no longer reports attempt 3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 30, 2026
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.
改动
修正 #55 压缩摘要的两处问题,并加强用户原话的保留。缺陷记录 B-039、B-040。
刻意未改
压缩后附回文件内容、附完整记录路径、摘要复用提示词缓存,这几项改动面更大,不在本 PR。推理选择规则、静默超时、失败兜底语义都不变。
验证
pnpm lint通过。git diff --check、文档检查(644 页)通过;6 条提示是既有的上游 ADR 格式提示。未调用真实模型。40% 的比例和原话规则依据参考实现推算,真实模型的截断率和摘要保真未测。
🤖 Generated with Claude Code