Skip to content

Commit 1e76736

Browse files
committed
fix: increase min max output tokens to 2048 to support reasoning models
- Changed minimum max output tokens from 1000 to 2048 - This ensures reasoning models always have enough tokens: - Thinking tokens: 1024 min to 1638 max (80% of 2048) - Output tokens: at least 410 tokens guaranteed (20% of 2048) - Updated tests to reflect the new minimum value - This solves the issue where the thinking tokens slider was unusable with low max token values
1 parent 9c2fb52 commit 1e76736

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ const ApiOptions = ({
579579
value={apiConfiguration.modelMaxTokens}
580580
onChange={(value) => setApiConfigurationField("modelMaxTokens", value)}
581581
modelInfo={selectedModelInfo}
582-
minValue={1000}
582+
minValue={2048}
583583
maxValue={selectedModelInfo?.maxTokens || 200000}
584584
/>
585585
<RateLimitSecondsControl

webview-ui/src/components/settings/MaxTokensControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const MaxTokensControl: React.FC<MaxTokensControlProps> = ({
1616
value,
1717
onChange,
1818
modelInfo,
19-
minValue = 1000,
19+
minValue = 2048,
2020
maxValue,
2121
className,
2222
}) => {

webview-ui/src/components/settings/__tests__/MaxTokensControl.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe("MaxTokensControl", () => {
111111
})
112112

113113
test("should show validation error when value is below minimum", () => {
114-
render(<MaxTokensControl {...defaultProps} value={500} minValue={1000} />)
114+
render(<MaxTokensControl {...defaultProps} value={500} minValue={2048} />)
115115

116116
expect(screen.getByText("settings:providers.maxOutputTokens.validation.tooLow")).toBeInTheDocument()
117117
})
@@ -163,7 +163,7 @@ describe("MaxTokensControl", () => {
163163
})
164164

165165
test("should apply error styling when validation fails", () => {
166-
render(<MaxTokensControl {...defaultProps} value={500} minValue={1000} />)
166+
render(<MaxTokensControl {...defaultProps} value={500} minValue={2048} />)
167167

168168
const input = screen.getByRole("spinbutton")
169169
expect(input.className).toContain("border-red-500")

0 commit comments

Comments
 (0)