Skip to content

feat: display Extra Usage fuel pack balance in /usage and /status#1501

Merged
liruifengv merged 22 commits into
mainfrom
feat/extra-usage-fuel-pack
Jul 9, 2026
Merged

feat: display Extra Usage fuel pack balance in /usage and /status#1501
liruifengv merged 22 commits into
mainfrom
feat/extra-usage-fuel-pack

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. The platform /usages endpoint added a boosterWallet field representing the prepaid "fuel pack" (加油包) balance, and users need visibility into that balance from the TUI.

Problem

The TUI /usage and /status commands already show session token usage, context window utilization, and Plan usage from /usages, but the new boosterWallet balance was ignored. Users could not see how much Extra Usage they had remaining.

What changed

  • Extended packages/oauth/src/managed-usage.ts to parse boosterWallet.balance (type BALANCE_BOOSTER) into a UsageRow with used = amount - amountLeft and limit = amount, handling string amounts and clamping used to [0, amount].
  • Propagated the new extraUsage field through AuthManagedUsageResult.
  • Added an Extra Usage section to the /usage panel (usage-panel.ts) and /status panel (status-panel.ts), reusing the existing Plan usage progress-bar visual language.
  • Wired extraUsage through apps/kimi-code/src/tui/commands/info.ts.
  • Added tests for parser, toolkit propagation, and both panel renderers.

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.

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 94867bc

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

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kimi-code Patch
@moonshot-ai/kimi-code-sdk Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

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

commit: 94867bc

@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: a742241c9c

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

Comment thread packages/oauth/test/managed-usage.test.ts Outdated
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@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: ce260d66f4

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

Comment thread packages/oauth/src/managed-usage.ts
@liruifengv liruifengv merged commit b91099e into main Jul 9, 2026
10 checks passed
@liruifengv liruifengv deleted the feat/extra-usage-fuel-pack branch July 9, 2026 09:45
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
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