Repository navigation
fix(session): stop compacting every turn on a 32k-window model - #183
Merged
Merged
Conversation
usable() reserved min(20000, output) for the reply. On redrob/free (32768 context, 32000 output) that left 8937 tokens, under the system prompt and tool list, so each turn overflowed: a one-line question was summarised and auto-continued five times in one run. Cap the reserve at a quarter of the window.
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's done
usable()inpackages/redrob/src/session/overflow.tsnow reserves at most a quarter of the context window for the reply:min(20000, output, budget / 4).redrob/free(32,768 context, 32,000 output) the old reserve left 8,937 tokens, less than the system prompt and tool list (~12,000). Every turn overflowed, soredrob run "오늘 날씨 뭐야?"answered, summarised and auto-continued five times in one run. With the cap the compaction point is about 17,200 tokens.min(20000, output).What's not done
What to review
usable()and the updated source assertion intest/session/threshold-and-cost.test.ts.Intentions
Small-window models such as the free Console model should compact when the conversation is actually long, not on the first turn.
Checked:
bun run typecheck,bun test test/session test/provider(1038 pass).