Conversation
|
Size Change: -53 B (0%) Total Size: 12.5 MB ℹ️ View Unchanged
|
Collaborator
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug where chat history compression could fail for large contexts. By removing the maxOutputTokens parameter from the compression API call, the change avoids hitting unknown model-specific limits, which was causing errors. The existing post-compression check that verifies if the new token count is smaller than the original remains, ensuring the change is safe and doesn't introduce regressions. The fix is well-reasoned and effectively resolves the issue.
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
a78aeec to
e17aa10
Compare
e17aa10 to
6e0b437
Compare
jacob314
approved these changes
Sep 8, 2025
SandyTao520
pushed a commit
that referenced
this pull request
Sep 10, 2025
giraffe-tree
pushed a commit
to giraffe-tree/gemini-cli
that referenced
this pull request
Oct 10, 2025
This was referenced Oct 15, 2025
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.
TLDR
Don't specify maxOutputTokens to avoid errors when we set it too high.
Dive Deeper
Setting maxOutputTokens was only introduced two weeks ago in #7047 probably to try to make sure the model didn't output a compression larger than the original context. But each model has a maximum value allowed for
maxOutputTokensand we don't know what it is.We could add a max limit to this to make sure we don't send a value that's too large but I think it would be overkill so I'm just taking it out completely.
Reviewer Test Plan
Load up a context with more than 65537 tokens and try to compress it.
Testing Matrix
Linked issues / bugs
Fixes #7784