feat: increase max tool compression candidates from 5 to 15#81
Merged
Conversation
The breakdown and tool-output reminder only showed 5 candidates, causing the model to compress too narrowly (1 message per batch). Increasing to 15 gives the model more compression candidates at once. Changed: - utils.ts: largestRanges 10→15, largestToolRanges 5→15 - inject.ts: toolOutputReminder topRanges 5→15 issue #13
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
Split out from #80 per @Dog's request — that PR is pending review and this
independent improvement should not be blocked by it.
The context breakdown and tool-output reminder only surfaced 5 (or 10)
compression candidates, causing the model to compress too narrowly (often
one message per
compresscall). The system prompt asks for 20+ messageranges per call, but the candidate list did not back that up.
Changes (3 lines, 2 files)
lib/messages/inject/utils.ts:652—largestRanges10 → 15lib/messages/inject/utils.ts:653—largestToolRanges5 → 15lib/messages/inject/inject.ts:214—toolOutputRemindertop ranges 5 → 15Code/text candidate lists (
largestCodeRanges,largestMessageRanges) stayat 5 — they are informational, not the primary compression target.
Why split
Bundling this into #80 (Bug 39: compression summary role) blocked both from
shipping. This PR is self-contained: no config, no persisted-state, no
prompt-template changes.
Verification
npm run typecheck✅npm run build✅ (356 KB)issue #13