Spill oversized tool results into the committed blob store - #585
Merged
TheGreatAxios merged 1 commit intoAug 23, 2026
Merged
Conversation
|
All contributors have signed the CLA. |
Results over MAX_RESULT_CHARS were truncated and the tail was simply lost, so a model that needed the rest had to re-run the command. The notice could not offer a way to recover it — the plugin's own comment forbade promising blob retrieval it could not honor. The full pre-cut content is now written through ContextStore.writeBlob, which stages it for the same commit as the turn that produced it, and the notice names the resulting tool-output:/// URI for read_file. Spilled output is part of the immutable session record rather than a temporary file: no cleanup, no cap, no eviction. With no blob store configured the notice says the remainder is not retrievable rather than claiming a capability that does not exist.
TheGreatAxios
force-pushed
the
cl-6965-oversized-tool-results-should-spill-to-a-file-the-agent-can
branch
from
August 23, 2026 22:06
bb1d63f to
8c414b5
Compare
TheGreatAxios
enabled auto-merge
August 23, 2026 22:08
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.
Closes CL-6965.
Results over
MAX_RESULT_CHARS(grep,run_shell,search_files,web_fetch, MCP) were truncated with the tail discarded, so recovering it meant re-running the command. Measured consequence in the trace data behind CL-6961: the model re-pays for output it already generated.What changed
The full pre-cut content is written via
ContextStore.writeBlob, so it is staged into the same commit as the turn that produced it, and the notice names the resultingtool-output:///{key}URI to read back withread_file.That last part matters beyond convenience: CL-6908 recorded the size cap telling the model "full output available" while pointing at content that had already been truncated, and the truncation plugin has carried a comment ever since forbidding a promise it could not keep. Going through the blob store makes the promise real.
Why it is committed, not cleaned up
An earlier revision of this work wrote to a
tool-output-spilldirectory beside the blob store and told the model the file would be "removed when this session ends." Nothing removed it, and nothing staged it either — so the output was neither cleaned up nor part of the record.Spilled tool output belongs in the immutable git turn history alongside every other input, output, and tool result. There is no cleanup policy, no size cap, and no eviction, and the notice makes no lifetime claim.
Honest fallback
With no blob store (tests, ad-hoc toolsets) the notice says the remainder is not retrievable and re-running gives the same cut, rather than naming a handle that would not resolve.
read_fileis unaffected — it is short-circuited by the guard plugin before this cap and got a resumable cursor in CL-6961 instead.Verification
bun run checkgreen in full.