fix(quota): correct current_interval_usage_count to hold actual usage#69
fix(quota): correct current_interval_usage_count to hold actual usage#69xandersbell wants to merge 1 commit intoMiniMax-AI:mainfrom
Conversation
API fields current_interval_usage_count and current_weekly_usage_count actually hold remaining quota (not usage as the name implies). This caused --output json to expose semantically incorrect data. Changes (no schema change — only fix field values): - --output json: usage_count now holds actual usage (total - original_value) - --quiet: correct used/remaining computation using fixed values - table rendering already correct (was treating usage_count as remaining) Closes MiniMax-AI#68
Commit history noteInitial version of this PR introduced new fields ( After discussion we reverted to fixing only the existing field values in-place — no new fields, no schema change. This approach respects the original API contract and avoids breaking any downstream consumers that may depend on the exact field names. |
|
Note: The root cause is upstream — the API itself returns remaining quota in fields named |
Summary
API fields
current_interval_usage_countandcurrent_weekly_usage_countactually hold remaining quota (not usage as the name implies). This causedmmx quota show --output jsonto expose semantically incorrect data.Root cause
The upstream API itself returns remaining quota in fields named
current_interval_usage_count/current_weekly_usage_count. The ideal fix would be upstream renaming the fields to match their actual semantics.Why this approach
We evaluated two options:
current_interval_remaining_count): Cleaner semantics but changes the JSON schema, breaking any downstream consumers that depend on exact field names.We chose option 2.
Changes (no schema change — only fix field values)
src/commands/quota/show.ts--output json:current_interval_usage_countnow holds actual usage (total - original_value). Same for weekly fields.--quiet: Uses fixed values for correct used/remaining display.test/commands/quota/show.test.ts: 5 test cases covering all output modes.Closes #68