Skip to content

fix(windows): name every row by the window it measures - #514

Open
niheaven wants to merge 7 commits into
slkiser:mainfrom
niheaven:fix/windows
Open

niheaven wants to merge 7 commits into
slkiser:mainfrom
niheaven:fix/windows

Conversation

@niheaven

@niheaven niheaven commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What users see change

A row that measures a window is named by that window, the same way for every provider; counts and units stay in the numbers; the account names the account.

Windows list short to long. A shorter window is the tighter limit, so it belongs first. A row labelled 30d also counts as a month now, which gives it a pace and an even-use mark it did not have.

One name per window. The same window was called 5h, 5h limit or Gemini 5h depending on the provider, so a name written for one row did not match another's. A row's name is the window it measures: 5 Hour instead of 5h or 5h limit, Monthly instead of Credits, Premium interactions or Premium requests. The account stays in the account's title and the counts stay in the numbers.

Copilot bills in AI credits. The reply reports credits_used and entitlement itself. The plugin computed entitlement minus remaining instead, which is 86.9 where the vendor says 86, and it labelled the row Premium interactions after a bucket the vendor no longer bills that way.

An Alibaba seat is its own account. A Token Plan with several seats is several accounts, not several rows of one account, so each seat is titled (team <name>) and its row says what it measures: Monthly.

Kimi reads the ratios. The reply carries the same quota twice: counts in usage and limits[], ratios in usages. The first-party CLI (@moonshot-ai/kimi-code) reads the ratios, so the plugin reads them too — one row per window, and no arithmetic to turn a count into a percentage. limit_month_code is the Code share inside the monthly pool, not an allowance of its own, so it is a /quota_status detail and the month stays one row.

The Settings page names an account where it is needed. The tree lists a provider's rows without their account headings, so two seats of one plan would read the same. The account is named only where two rows of one provider would read the same.

before                                   after
Kimi Code (CN)                           Kimi Code (CN)
  Weekly limit  100% left  4.7d            5 Hour   100% left  4h 25m
  5h limit      100% left  4h 25m          Weekly   100% left  4.7d
Copilot (individual)                     Copilot (individual)
  Premium interactions                      Monthly
  86.9 interaction / 1500 interaction       86 credit / 1500 credit   (94.2% left)
Alibaba Token Plan (rmpub)               Alibaba Token Plan (team rmpub)
  Credits  36% left                         Monthly  36% left
Alibaba Token Plan (etfpub)              Alibaba Token Plan (team etfpub)
  Credits  53% left                         Monthly  53% left

Settings page, Alibaba with two seats: Credits, Credits → team rmpub · Monthly, team etfpub · Monthly; a provider whose rows are distinct keeps the bare label.

The sidebar keeps its short names (5h, 7d, 30d): this PR is about the spelled name, the CLI, the export, the Settings page and reset notices (5 Hour quota reset: …).

Nothing visible in the last commit: it renames two Kimi row ids to the shared keys (limit.5h → five_hour, limit.monthly_total → monthly; weekly stays). A stored hidden, rowOrder or names entry for the two old ids then stops matching — a hidden Kimi row shows again, a renamed one loses its name. CONTRIBUTING asks that a released row key not change, so it is a separate commit; drop it to keep the old ids.

Linked issue

Fixes #512

Before and after screenshots

Same config, theme and window size; account names and paths hidden. Before is the published 6.3.0.

Surface Before After
TUI sidebar, open Before: rows named "Credits", "5h limit", "Weekly limit" After: rows named "Monthly", "5 Hour", "Weekly"
/quota → Limits Before: "Premium interactions" and "Credits" rows After: "Monthly" rows for every provider
Settings → Layout, a two-seat plan Before: two rows named "Credits" After: "team rmpub · Monthly" and "team etfpub · Monthly"
Toast after a reply Before: a toast with the old row names After: a toast with the new row names

A window-reset toast is not in these shots: it needs a window to reset while the plugin runs. The words are the same rows as above, prefixed 5 Hour quota reset: ….

/quota_status --provider kimi-code-plan-cn, before (6.3.0) and after — same four rows, now named and sorted short window first:

- rows: 4
  - kimi-code-plan-cn.weekly (account 1): window=week, 100% left, resets 2026-11-21T08:37:17.000Z
  - kimi-code-plan-cn.limit.(part 1) (account 1): window=five_hour, 100% left, resets 2026-11-20T14:37:17.000Z
  - kimi-code-plan-cn.weekly: window=week, 100% left, resets 2026-11-21T08:37:17.000Z
  - kimi-code-plan-cn.limit.(part 1): window=five_hour, 100% left, resets 2026-11-20T14:37:17.000Z
- rows: 4
  - kimi-code-plan-cn.five_hour (account 1): window=five_hour, 100% left, resets 2026-11-20T14:37:16.000Z
  - kimi-code-plan-cn.weekly (account 1): window=week, 100% left, resets 2026-11-21T08:37:15.000Z
  - kimi-code-plan-cn.five_hour: window=five_hour, 100% left, resets 2026-11-20T14:37:16.000Z
  - kimi-code-plan-cn.weekly: window=week, 100% left, resets 2026-11-21T08:37:16.000Z

No monthly_code_ratio line here: this plan reports no monthly pool.

CLI show and /quota_export text for Kimi Code (CN), Copilot and Alibaba Token Plan is in "What users see change" above.

Checklist

  • I ran pnpm verify
  • I tested on released OpenCode version: 2.3.2
  • For provider changes, I followed Provider Changes, or this does not apply

Checklist

Every other provider stores the five-hour window as `five_hour` and the monthly one as `monthly`,
so Kimi's rows were the only ones named after the label they happened to carry. Two released ids
move: `limit.5h` -> `five_hour`, `limit.monthly_total` -> `monthly`; `weekly` stays.

A row id is stored in users' settings, so a `hidden`, `rowOrder` or `names` entry for the two old
ids no longer matches. Nothing else reads them, and the ids stop moving when a label changes.
Drop this commit to keep the old ids and only the labels.
@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quota rows don't say what they measure

1 participant