feat(compaction): Handle when models have input limit#6875
Open
shantur wants to merge 1 commit intoanomalyco:devfrom
Open
feat(compaction): Handle when models have input limit#6875shantur wants to merge 1 commit intoanomalyco:devfrom
shantur wants to merge 1 commit intoanomalyco:devfrom
Conversation
7bb2959 to
b7de78d
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
lightsofapollo
added a commit
to lightsofapollo/opencode
that referenced
this pull request
Feb 10, 2026
…nput is set isOverflow() uses `limit.input` directly without subtracting output token headroom, unlike the `context - output` fallback path. This means models with an explicit input limit (e.g. Claude with prompt caching) don't trigger compaction until the full input budget is consumed, leaving zero room for the next response. Three tests added: - Near-boundary case: 198K/200K used, should compact but doesn't - Parity test: same tokens correctly trigger compaction without limit.input - Asymmetry test: identical 200K models diverge by exactly 32K (the missing output headroom) Related: anomalyco#10634, anomalyco#8089, anomalyco#11086, anomalyco#12621 See also: anomalyco#6875, anomalyco#12924
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.
No description provided.