Skip to content

feat(tui): show usage cache stats#930

Open
tt-a1i wants to merge 1 commit into
MoonshotAI:mainfrom
tt-a1i:fix/usage-cache-stats
Open

feat(tui): show usage cache stats#930
tt-a1i wants to merge 1 commit into
MoonshotAI:mainfrom
tt-a1i:fix/usage-cache-stats

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Jun 20, 2026

Copy link
Copy Markdown

Related Issue

Resolve #884

Problem

/usage already counted prompt-cache tokens as part of input, but it did not show cache read/write counts separately.

What changed

  • show per-model prompt cache read/write token counts when they are non-zero
  • show aggregate cache read/write counts in the multi-model total section
  • keep the existing input/output/total lines unchanged
  • add coverage for cache rows, multi-model totals, and no-cache output

Validation

  • pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/components/messages/usage-panel.test.ts
  • pnpm --filter @moonshot-ai/kimi-code run typecheck
  • pnpm exec oxlint --type-aware apps/kimi-code/src/tui/components/messages/usage-panel.ts apps/kimi-code/test/tui/components/messages/usage-panel.test.ts --quiet
  • pnpm --filter @moonshot-ai/kimi-code run test
  • git diff --check

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

gen-docs is not needed here because the existing command docs already describe /usage; this only adds detail to the rendered usage panel.

AI Assistance Disclosure

I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.

@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b412d97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

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

@tt-a1i tt-a1i marked this pull request as ready for review June 20, 2026 04:20
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.

Show cache statistics

1 participant