-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Adding Max Context Window setting for Gemini API provider #4360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
- added `MaxContextWindowControl.tsx` - added maxContextWindow in `settings.json`
… + modifying context window in context condensing for Gemini
…dded "maxContextWindow" to `settings.json`
- somehow Roo Code with Gemini 2.5 Pro deleted them during the task
…tWindow` overtakes the model's Gemini context window value setting
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…l.tsx Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…` for comprehension
This reverts commit 16ffd71.
Contributor
Author
5 tasks
23 tasks
Collaborator
|
stale |
| }, | ||
| "maxContextWindow": { | ||
| "maxContextWindow": "Janela de Contexto Máxima", | ||
| "useCustom": "Usar janela de contexto máximo personalizada", |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical: 'Usar janela de contexto máximo personalizada' should use 'máxima' instead of 'máximo' for grammatical agreement with 'janela' (feminine), e.g. 'Usar janela de contexto máxima personalizada'.
Suggested change
| "useCustom": "Usar janela de contexto máximo personalizada", | |
| "useCustom": "Usar janela de contexto máxima personalizada", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Enhancement
New feature or request
PR - Draft / In Progress
size:L
This PR changes 100-499 lines, ignoring generated files.
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.

The PR will allow developers to set the maximum value of the context window in configuration profile, only for Gemini.
Related GitHub Issue
Closes: #3717
Description
Test Procedure
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Max Context Window in Configuration Profile
Displaying Gemini's Max Context Window
Testing Max Context Window with Intelligent Context Condensing
The set maximum context window is 32 000 tokens. Allowed tokens is:
const allowedTokens = contextWindow * (1 - TOKEN_BUFFER_PERCENTAGE) - reservedTokens, which in our case would be around ~22 000 tokens. Which proves that this PR works since the condensing was activated at 25 255 tokens.Documentation Updates
Additional Notes
Get in Touch
Important
Adds a configurable
maxContextWindowsetting for the Gemini API provider, updating schema, UI components, and tests to support this feature.maxContextWindowsetting togeminiSchemainprovider-settings.ts.GeminiHandleringemini.tsto usemaxContextWindowif set.TaskinTask.tsto respectmaxContextWindowfor Gemini.MaxContextWindowControlcomponent inMaxContextWindowControl.tsx.ApiOptions.tsxto includeMaxContextWindowControlfor Gemini.ModelInfoView.tsxto displaymaxContextWindow.maxContextWindowinTask.test.ts.MaxContextWindowControlinMaxContextWindowControl.test.tsx.maxContextWindowrelated strings in multiple languages.This description was created by
for 4e72a06. You can customize this summary. It will automatically update as commits are pushed.