feat: Adding Max Context Window setting for Gemini API provider#4360
Closed
HahaBill wants to merge 23 commits intoRooCodeInc:mainfrom
Closed
feat: Adding Max Context Window setting for Gemini API provider#4360HahaBill wants to merge 23 commits intoRooCodeInc:mainfrom
HahaBill wants to merge 23 commits intoRooCodeInc:mainfrom
Conversation
- added `MaxContextWindowControl.tsx` - added maxContextWindow in `settings.json`
… + modifying context window in context condensing for Gemini
…Bill/Roo-Code into feat/set-max-context-window
…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
…Bill/Roo-Code into feat/set-max-context-window
This reverts commit 16ffd71.
Contributor
Author
|
Hi! I think something is wrong with the GitHub Actions for platform-unit-test (windows-latest), I am seeing the same/similar error for latest PRs too:
When I changed this PR to from draft to ready to review, then there were not issues with GitHub Action. Once I added my changes because of |
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.
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", |
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.

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.