Skip to content

feat: increase max tool compression candidates from 5 to 15#81

Merged
ranxianglei merged 2 commits into
masterfrom
2026-07-09_more-compression-candidates
Jul 9, 2026
Merged

feat: increase max tool compression candidates from 5 to 15#81
ranxianglei merged 2 commits into
masterfrom
2026-07-09_more-compression-candidates

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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 compress call). The system prompt asks for 20+ message
ranges per call, but the candidate list did not back that up.

Changes (3 lines, 2 files)

  • lib/messages/inject/utils.ts:652largestRanges 10 → 15
  • lib/messages/inject/utils.ts:653largestToolRanges 5 → 15
  • lib/messages/inject/inject.ts:214toolOutputReminder top ranges 5 → 15

Code/text candidate lists (largestCodeRanges, largestMessageRanges) stay
at 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)
  • No test changes in this slice

issue #13

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
@ranxianglei ranxianglei merged commit 868ba2c into master Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant