-
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
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.
|
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 |
|
stale |
| }, | ||
| "maxContextWindow": { | ||
| "maxContextWindow": "Janela de Contexto Máxima", | ||
| "useCustom": "Usar janela de contexto máximo personalizada", |
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'.
| "useCustom": "Usar janela de contexto máximo personalizada", | |
| "useCustom": "Usar janela de contexto máxima personalizada", |

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.