Repository navigation
feat(tools): spill tool output as a tail-only window - #2425
Merged
Aaronontheweb merged 3 commits intoOct 9, 2026
Merged
Conversation
Keep only the last budget chars of an oversized tool result inline, instead of a symmetric head+tail split. The full result still spills to the session file, and the model continues through tool_output_read to pull the dropped front back. Rewrites BoundedOutputReader.Window and the BoundedOutputAccumulator to a single tail ring, and updates the reader and spill tests to assert tail-only behavior.
Aaronontheweb
enabled auto-merge (squash)
October 9, 2026 17:17
Aaronontheweb
disabled auto-merge
October 9, 2026 18:07
Aaronontheweb
force-pushed
the
feature/tool-spill-tail-window
branch
from
October 9, 2026 18:07
cbb9e87 to
eb7e718
Compare
Aaronontheweb
enabled auto-merge (squash)
October 9, 2026 18:07
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
Change tool-output spill bounding from a symmetric head+tail window to tail-only. When a tool result exceeds the inline budget, Netclaw keeps only the last
budgetchars inline and drops the head; the full result still spills to the session file, and the model continues throughtool_output_read(opaque CallId + Start/Limit) to pull the dropped front back.Why
The head+tail split is confusing and assumes useful content is evenly distributed. For command-like output (shell, logs, stack traces) the useful content is at the tail. Tail-only is simpler to reason about and matches how agents read command output.
tool_output_readalready recovers the dropped leading/middle content, so nothing is lost.What changed
BoundedOutputReader.Window: now returnsSeparator + last budget charswhen over budget.BoundedOutputAccumulator: rewritten to a single tail ring; removed the_headbuffer;Finish()still reportsTruncated.ToolOutputSpill: doc/comment updates only (no behavior change inCompose; it still names the opaque CallId).BoundedOutputReaderTestsandToolOutputSpillTeststo assert tail-only behavior.Verification
dotnet slopwatch analyze: 0 issues.