feat(quota): align types with coding-plan API, show boost multiplier#168
feat(quota): align types with coding-plan API, show boost multiplier#168raylanlin wants to merge 1 commit into
Conversation
- 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.
There was a problem hiding this comment.
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.
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:
Observed data (3 API calls, Max subscription)
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
Open questions for maintainers
Refs #166