mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-27 01:24:46 +00:00
v2 engine status events carry contextTokens/maxContextTokens but never contextUsage, so appState.contextUsage was only refreshed by getStatus pulls and then went stale while the token counts kept updating live. The /usage panel and footer render the ratio as a bar but recompute the percentage text from the counts, so a stale ratio showed as a bar that disagreed with the percentage (e.g. bar ~74% next to "18% (180k / 1M)" after compaction or a model switch). Recompute the ratio from the post-patch token counts whenever a status update touches contextTokens or maxContextTokens without carrying an explicit contextUsage. v1 events carry the ratio and are unaffected. Co-authored-by: kimi-agent-bot <kimi-agent-bot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| kimi-code | ||
| kimi-inspect | ||
| vis | ||
| vscode | ||