fix(tui): hide context usage when it is 0#953
Conversation
When a session starts, context usage is 0. Displaying 'context: 0.0%' in the footer is misleading because it implies the context window is empty. Instead, hide the context status line until there is actual usage to report. Fixes: initial Context usage should not show 0 or should be hidden.
|
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efb8f159ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| function formatContextStatus(usage: number, tokens?: number, maxTokens?: number): string { | ||
| if (usage <= 0) return ''; |
There was a problem hiding this comment.
Update zero-usage footer tests
This guard changes zero context usage to render no context text, but the existing footer-context tests still assert that context: 0.0% is present for contextUsage: 0 (for example apps/kimi-code/test/tui/components/panels/footer-context.test.ts:80 and :111). Any CI run that includes that test file will fail unless those expectations are updated to the new hidden zero-usage behavior.
Useful? React with 👍 / 👎.
When a session starts, context usage is 0. Displaying 'context: 0.0%' in the footer is misleading because it implies the context window is empty. Instead, hide the context status line until there is actual usage to report.
Before:
After:
Test:
Fixes: initial Context usage should not show 0 or should be hidden.