Repository navigation
fix(cli): prune old tool outputs in single-turn subagents - #13713
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 226.1K · Output: 18.8K · Cached: 410.6K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 2, 2026 19:34
intentionally-left-nil
approved these changes
Sep 3, 2026
This was referenced Sep 6, 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.
What Problem This Solves
Long-running Task and background subagents can execute many model/tool steps within one user turn. The two-user-turn pruning guard keeps all those outputs ineligible, including when the payload-limit safeguard runs.
Fixes #13710.
Why This Change Was Made
Allow older completed tool outputs to become eligible after two finished, non-error assistant steps. Keep the existing user-turn path, token protection and minimum, protected tools, and configuration guards. Stop only the new step-based fallback at summaries so existing post-compaction cleanup still works. Failed, preflight, and in-flight attempts do not consume the step protection buffer.
The change stays inside the existing marked pruning block. It adds no model call or new pruning trigger.
User Impact
Long single-turn runs can drop stale tool outputs at existing pruning boundaries without losing the recent working context or protected skill output. Normal pruning remains opt-in, and explicit
compaction.prune: falsestill disables pruning. This is not a hard payload-size cap when recent or protected content is itself large.Evidence
The smoke test used a local simulated provider, not a live model. No billing or latency improvement is claimed.