Repository navigation
Conversation
…eatures Kimi's monthly membership pool is shared across features, and both sources already report Kimi Code's share of it: `limit_month_code` from the Code API and `kimiCodeUsedRatio` from web membership statistics. Show that share as a "Total usage" detail section with Kimi Code and Other features rows, taking the Code ratio from the same source that supplies the Total usage lane. The shares draw on one limit, so they stay detail rows rather than quota windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds Kimi Code and Other features detail rows beneath the shared monthly Total usage pool. Example: The Code API reports monthly total usage of 0.5761 and Code usage of 0.0426.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR adds a distinct breakdown absent from main, with no concrete correctness findings; the new feature needs an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherKimi response models feed the provider snapshot converter, which selects authoritative quota data and supplies shared detail rows to menu and CLI renderers. flowchart LR
A[Code API pools] --> C[Kimi usage snapshot]
B[Web membership statistics] --> C
C --> D[Same source monthly selection]
D --> E[Shared quota and detail rows]
E --> F[Menu card]
E --> G[CLI output]
Technical reviewBest possible solution: Use existing provider-detail rows for same-source monthly attribution while retaining Total usage as the shared monthly quota. Do we have a high-confidence way to reproduce the issue? Source inspection confirms main ignores limit_month_code and does not render kimiCodeUsedRatio; linked real response fixtures establish that both sources can supply the requested attribution. Is this the best way to solve the issue? The implementation is appropriately small: it selects total and Code ratios together, preserves existing quota precedence and guards, and reuses shared detail rendering without adding competing quota windows. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d34fbb47afe7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 9:10 AM ET / 13:10 UTC (Revision 2). |
Summary
Kimi's monthly membership pool is shared across Kimi features (chat, agents, Kimi Code). CodexBar shows that pool as the Total usage lane, but both Kimi sources also report how much of it Kimi Code used, and CodexBar currently drops that:
GET /coding/v1/usages):usages.limit_month_code.used_ratio, next tolimit_month_total. It appears in the responses attached to Kimi Code (API key): ratio-pool /coding/v1/usages response fails to decode — "The data couldn’t be read because it is missing." #3694 and Kimi: contradictory legacy/ratio response renders 100% on exhausted 5h window #4306, and Kimi Code (API key): ratio-pool /coding/v1/usages response fails to decode — "The data couldn’t be read because it is missing." #3694 notes that the official@moonshot-ai/kimi-codeCLI shows a Kimi/Code breakdown from these two pools.GetSubscriptionStats):subscriptionBalance.kimiCodeUsedRatio. Kimi: hide Code 7-day row when it duplicates the weekly lane #2741 confirmed that this is the Code share of the total (Kimi's own UI tooltip shows it as "Kimi Code usage");KimiCreditBalancedecodes it, but nothing uses it.This PR adds a Total usage detail section with two rows, shown only when both ratios are present:
limit_month_code/kimiCodeUsedRatio)Design notes
extraRateWindowsstays["kimi-monthly"], and the Total usage headline still uses the shared pool, as decided in [codex] Add Kimi monthly subscription usage #1839.monthlyPool(), which returns the window, its used ratio and the matching Code ratio. Its guards are unchanged.kimi-monthly-code,kimi-monthly-other) andprogress(total: 1), so their bars add up to the Total usage bar. Values useUsageFormatter.usageLine(…, showUsed: true)("4% used") because a per-feature "left" value means nothing."Total usage"key, and "Kimi Code" is a product name."Other features"is new, added to all 23 app catalogs (check-app-locales.mjspasses). Native speakers are welcome to refine the translations.Example
Code API pools
limit_month_total: 0.5761,limit_month_code: 0.0426:When the pool is exhausted, the breakdown stays visible next to "Blocked by monthly limit", which shows where the pool went.
Tests
KimiMonthlyBreakdownTests: Code API pools; web stats through both web and Code-API enrichment; no mixing of sources; missing or invalid ratios; Code share above the total (Other floors at 0); exhausted pool shown with bonus credits in the menu card model and no new metrics; JSON encoding with stable ids.KimiMonthlyBreakdownCLITests: CLI text and card lines.KimiGiftBalanceTests.fetchgains an optionalcodeAPIfixture parameter, with the old default.Commands run (macOS, Swift 6.4):
The full suite is left to PR CI, per AGENTS.md. No live provider probes or Keychain access; only fixture/stub transports. No screenshot: the only UI change is two rows in the existing provider-details section, covered through the menu card model.
Related: #3694, #4306, #2741.
🤖 Generated with Claude Code