We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0666cbd commit 3296bd6Copy full SHA for 3296bd6
webview-ui/src/utils/model-utils.ts
@@ -101,7 +101,8 @@ export const calculateTokenDistribution = (
101
// Get the actual max tokens value from the model
102
// If maxTokens is valid, use it, otherwise reserve 20% of the context window as a default
103
const defaultReserved = Math.ceil(safeContextWindow * 0.2)
104
- const reservedForOutput = maxTokens && maxTokens > 0 && maxTokens < defaultReserved ? maxTokens : defaultReserved
+ const reservedForOutput =
105
+ maxTokens && maxTokens > 0 && maxTokens === safeContextWindow ? defaultReserved : (maxTokens ?? defaultReserved)
106
107
// Calculate sizes directly without buffer display
108
const availableSize = Math.max(0, safeContextWindow - safeContextTokens - reservedForOutput)
0 commit comments