Commit 0d9ce1f
committed
fix: clamp output token count to prevent negative values
When a provider reports reasoningTokens > outputTokens (observed
with kimi-k2.5 thinking variant via Kilo gateway), the subtraction
in getUsage produces a negative output token count. This propagates
into the TUI, extension UI, session exports, and lifetime stats.
Clamp the result to zero to prevent negative display values.
Fixes #9168
Made-with: Cursor1 parent f0dd035 commit 0d9ce1f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
0 commit comments