Skip to content

feat(quota): align types with coding-plan API, show boost multiplier#168

Open
raylanlin wants to merge 1 commit into
MiniMax-AI:mainfrom
raylanlin:feat/quota-status-boost
Open

feat(quota): align types with coding-plan API, show boost multiplier#168
raylanlin wants to merge 1 commit into
MiniMax-AI:mainfrom
raylanlin:feat/quota-status-boost

Conversation

@raylanlin
Copy link
Copy Markdown
Collaborator

Background

PR #166 (commit 57c09c7) switched the quota endpoint to /v1/api/openplatform/coding_plan/remains and added *_remaining_percent to QuotaModelRemain. But the actual API response includes 4 additional fields that were not declared or rendered:

  • current_interval_status (number, observed 1 = partial / 3 = full)
  • current_weekly_status (number, observed 1 = partial / 3 = full)
  • interval_boost_permille (number, e.g. 2000 = 2x base)
  • weekly_boost_permille (number, e.g. 2000 = 2x base)

Observed data (3 API calls, Max subscription)

Field general (5h) general (weekly) video
*_status 1 (87% remaining) 1->3 (98%->100%) 3 (100% remaining)
*_boost_permille 2000 2000 absent

When *_remaining_percent hit 100%, *_status flipped from 1 to 3 — so the status is a percent mapping (1=partial, 3=full), not an independent state field. The percent color display already conveys this, so we don't render status separately.

Changes

  1. src/types/api.ts: Add 4 optional fields to QuotaModelRemain
  2. src/output/quota-table.ts: When boost_permille > 1000, prepend xN to the model name (e.g. "通用 x2")
  3. test/output/quota-table.test.ts: Add 2 test cases covering with-boost and without-boost rendering

Open questions for maintainers

  • Are there other status enum values (0/2/4) we haven't observed? Our account has never exhausted the quota.
  • Is boost_permille stable across all subscription tiers, or only certain ones (we have Max data)?
  • Should the boost tag position be next to model name (current), or in a separate column?

Refs #166

- types: add 4 optional fields (interval_status, weekly_status, boost_permille x 2)
- render: prepend 'xN' to model name when boost_permille > 1000
- tests: add 2 cases (with boost, without boost)

PR MiniMax-AI#166 missed these fields. status is not separately rendered since
percent already conveys the state (1=partial, 3=full). boost informs
the user about their 2x subscription multiplier.
Copy link
Copy Markdown

@TumCucTom TumCucTom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good API-alignment fix. the "observed data" table with real Max-subscription values is what makes this PR work — reviewers can verify field semantics against your data instead of guessing from the API docs.

two things:

I don't see in the diff snippet whether quota-table.ts actually renders the new fields. if the response has current_interval_status and the table just shows percentage remaining, the new status field is invisible to the user. worth confirming the renderer is updated to show partial/full alongside the percent.

naming: *_status and *_boost_permille matching the API is good for the wire format, but for human-facing a JSDoc comment on the type spelling out the enum (1 = partial, 3 = full — your table implies that) would make the type self-documenting. and if a future feature exposes the boost multiplier to the user, "2.0x" or "200%" reads better than "2000 permille" — *_PERMILLE is fine for storage but UI text should be different.

approved.

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.

2 participants