fix(chat): clamp context remaining tokens to 0 instead of showing negative (#202)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ const totalTokens = computed(() => {
|
||||
return input + output
|
||||
})
|
||||
|
||||
const remainingTokens = computed(() => contextLength.value - totalTokens.value)
|
||||
const remainingTokens = computed(() => Math.max(0, contextLength.value - totalTokens.value))
|
||||
|
||||
const usagePercent = computed(() =>
|
||||
Math.min((totalTokens.value / contextLength.value) * 100, 100),
|
||||
|
||||
Reference in New Issue
Block a user