Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion webview-ui/src/utils/model-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export const calculateTokenDistribution = (

// Get the actual max tokens value from the model
// If maxTokens is valid, use it, otherwise reserve 20% of the context window as a default
const reservedForOutput = maxTokens && maxTokens > 0 ? maxTokens : Math.ceil(safeContextWindow * 0.2)
const reservedForOutput =
maxTokens && maxTokens > 0 && maxTokens !== safeContextWindow ? maxTokens : Math.ceil(safeContextWindow * 0.2)

// Calculate sizes directly without buffer display
const availableSize = Math.max(0, safeContextWindow - safeContextTokens - reservedForOutput)
Expand Down