Skip to content

fix(shell): correct /usage remaining quota display#2078

Merged
wbxl2000 merged 1 commit into
mainfrom
codex/fix-usage-remaining-quota
Apr 26, 2026
Merged

fix(shell): correct /usage remaining quota display#2078
wbxl2000 merged 1 commit into
mainfrom
codex/fix-usage-remaining-quota

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2019.

This updates /usage so the displayed % left label, progress bar fill, and warning color all use the remaining quota ratio consistently. High remaining quota now renders as green/full, while near-exhausted quota renders yellow or red.

Thanks to #2039, #2046, and #1411 for the related reports and proposed fixes that helped converge on the behavior here.

Changes

  • Render the quota bar using remaining quota instead of used quota.
  • Flip _ratio_color thresholds to treat low remaining quota as dangerous.
  • Clamp unusual API values so over-used or negative-used rows do not overfill the bar.
  • Add regression tests for remaining quota colors, progress fill, zero-limit, over-used, and reset hint rendering.
  • Add release-note entries in English and Chinese changelogs.

Tests

  • uv run ruff check src/kimi_cli/ui/shell/usage.py tests/ui/test_usage.py
  • uv run ruff format --check src/kimi_cli/ui/shell/usage.py tests/ui/test_usage.py
  • uv run pytest tests/ui/test_usage.py
  • make check-kimi-cli

Note: make check-kimi-cli exits 0. ty check is non-blocking in the Makefile and still reports existing repo-wide diagnostics unrelated to this change.

Copilot AI review requested due to automatic review settings April 26, 2026 11:21
devin-ai-integration[bot]

This comment was marked as resolved.

This comment was marked as resolved.

@wbxl2000
wbxl2000 force-pushed the codex/fix-usage-remaining-quota branch 2 times, most recently from c30ed8b to 4cdba33 Compare April 26, 2026 11:34
@wbxl2000

Copy link
Copy Markdown
Collaborator Author
image

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@wbxl2000
wbxl2000 force-pushed the codex/fix-usage-remaining-quota branch from 4cdba33 to 1ff7623 Compare April 26, 2026 12:14
@wbxl2000
wbxl2000 force-pushed the codex/fix-usage-remaining-quota branch from 1ff7623 to 433e378 Compare April 26, 2026 12:25
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@wbxl2000
wbxl2000 merged commit bfd9d27 into main Apr 26, 2026
14 checks passed
@wbxl2000
wbxl2000 deleted the codex/fix-usage-remaining-quota branch April 26, 2026 13:26
DaviRain-Su added a commit to DaviRain-Su/kimi-cli that referenced this pull request Apr 27, 2026
fix(shell): correct /usage remaining quota display (MoonshotAI#2078)
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.

Wrong usage color

2 participants