Repository navigation
Digest stale tool results before the next model turn - #383
Draft
tylerreckart wants to merge 1 commit into
Draft
tylerreckart wants to merge 1 commit into
tylerreckart wants to merge 1 commit into
Conversation
The model view keeps the newest tool batch in full and replaces older bulky envelopes with the writ, an ok/ERR status, and any presence note or loop warning. Stored history is unchanged. Compaction now recognizes live tool envelopes when choosing the kept tail, and the summarize call uses the same digest. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
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.
Summary
Every tool batch was resent in full on later turns until compaction, so a few
/readand/execresults crowded the prompt the model was trying to think with. The model view now keeps the newest tool batch intact and replaces older bulky envelopes with a digest: the writ line,ok, N bytes omittedor the firstERR:line, plus any presence note or loop warning. Results under 4 KB stay whole. Stored history and replay are unchanged.Compaction also treats a live
[END TOOL RESULTS]envelope as a tool re-entry when choosing the kept tail (those envelopes do not start with the[TOOL RESULTS]prefix). The summarize call uses the same digest, so that extra model call is no longer a second copy of every file body.Set
ARBITER_TOOL_ELIDE_DISABLED=1to send every body.Test plan
unit_context_compaction— 35 cases, including digest vs newest-batch, image drop, line-startERR:only, live-envelope cut, and the disable env var/readshows up as a one-line digest