Skip to content

fix(tui): hide context usage when it is 0#953

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-20260621-1800
Open

fix(tui): hide context usage when it is 0#953
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-20260621-1800

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

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:

  • Footer shows on a fresh session

After:

  • Footer hides the context line when
  • Context status appears only after tokens have actually been consumed

Test:

  • Existing footer tests pass (3/3)

Fixes: initial Context usage should not show 0 or should be hidden.

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.
@changeset-bot

changeset-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: efb8f15

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 21, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@efb8f15
npx https://pkg.pr.new/@moonshot-ai/kimi-code@efb8f15

commit: efb8f15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant