-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Decouple Max Tokens from Max Thinking Tokens #3355
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
|
webview-ui/src/components/settings/__tests__/ApiOptions.test.tsx
Outdated
Show resolved
Hide resolved
* fix excessive markdown format character escaping * add changeset * made it a little more robust --------- Co-authored-by: Wesley Smith <[email protected]> Co-authored-by: Cline Evaluation <[email protected]>
|
Hey @cannuri, Thank you for your contribution! Sorry that we took so long to review this PR. I see that the issue still exists, non-thinking models with configurable However, due to recent changes to how thinking models are handled in the codebase, this PR needs some updates:
Would you be able to update the PR to work with the current model properties? I'd be happy to help if you need any clarification on the changes needed. Thanks again for your patience and for working on this fix! |
I am on it. |
f370101 to
1d3c2d2
Compare
- Replace modelInfo.thinking with supportsReasoningBudget properties - Update all tests to use new model property structure - Lower MIN_OUTPUT_TOKENS to 2048 for better usability - Add standalone MaxOutputTokensControl component
1d3c2d2 to
7b4f93c
Compare
|
Stale. fixed already. |
Related GitHub Issue
Closes: #3009 and #3010
Description
This PR addresses the issue where the "Max Tokens" configuration slider was not visible for certain models that have a configurable
maxTokensproperty but are not classified as "thinking" models.The solution involved refactoring the webview settings UI to decouple the "Max Output Tokens" slider from the "Max Thinking Tokens" slider.
Key implementation details:
webview-ui/src/components/settings/MaxOutputTokensControl.tsx, to handle the display and logic for the "Max Output Tokens" slider. This component's visibility is now solely based on the presence and value ofmodelInfo.maxTokens.webview-ui/src/components/settings/ThinkingBudget.tsxcomponent to only manage and display the "Max Thinking Tokens" slider. Its visibility remains tied tomodelInfo.thinking === trueandmodelInfo.maxTokens.webview-ui/src/components/settings/ApiOptions.tsxcomponent to conditionally render bothMaxOutputTokensControland the refactoredThinkingBudgetbased on their respective visibility logic.MaxOutputTokensControlcomponent to match the layout of theThinkingBudgetslider, displaying the numerical value to the right.providers.customModel.maxTokens.label) is used for the "Max Output Tokens" slider label.The development followed a granular, iterative Test-Driven Development (TDD) approach, with small cycles of writing/modifying tests and then implementing the corresponding code, as detailed in the
todo.mdfile.Test Procedure
The changes were developed and verified using a granular TDD workflow:
MaxOutputTokensControl,ThinkingBudget,ApiOptions), tests were written/modified firstManual UI verification is required to confirm the visual behavior:
maxTokens(e.g.,gemini-2.5-pro-exp-03-25with GCP Vertex AI): "Max Output Tokens" slider should be visible, "Max Thinking Tokens" should not.claude-3-7-sonnet-20250219:thinkingwith Anthropic): Both "Max Output Tokens" and "Max Thinking Tokens" sliders should be visible.maxTokensormaxTokens: 0: Neither slider related to these should be visible.Type of Change
srcor test files.Pre-Submission Checklist
npm run lint). (Addressed during development/testing)console.log) has been removed. (Addressed during development/testing)todo.md)npm test). (Confirmed during development cycles)mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Before:

After:

Documentation Updates
[ ] No documentation updates are required.
[ ] Yes, documentation updates are required. (Assess if user-facing documentation describing settings needs updating).
[x] I am not fully sure, but I guess no.
Important
Decouples Max Output Tokens and Max Thinking Tokens sliders in the UI, adding a new component for Max Output Tokens and refactoring existing logic, with comprehensive tests.
MaxOutputTokensControlcomponent inMaxOutputTokensControl.tsxto manage "Max Output Tokens" slider visibility based onmodelInfo.maxTokens.ThinkingBudget.tsxto only manage "Max Thinking Tokens" slider, visible whenmodelInfo.thinkingis true.ApiOptions.tsxto conditionally renderMaxOutputTokensControlandThinkingBudgetbased on model properties.MaxOutputTokensControl.test.tsxto test rendering and behavior of the new component.ApiOptions.test.tsxandThinkingBudget.test.tsxto reflect changes in component logic and rendering.Slidercomponent in__mocks__/Slider.tsxfor testing purposes.This description was created by
for 9be98c06b971d4a0481de520d994ad3c18e83ef1. You can customize this summary. It will automatically update as commits are pushed.