Skip to content

fix(quota): correct reversed used/remaining values in quiet mode#56

Open
BLUE-coconut wants to merge 1 commit intoMiniMax-AI:mainfrom
BLUE-coconut:fix/quota-quiet-mode-reversed-values
Open

fix(quota): correct reversed used/remaining values in quiet mode#56
BLUE-coconut wants to merge 1 commit intoMiniMax-AI:mainfrom
BLUE-coconut:fix/quota-quiet-mode-reversed-values

Conversation

@BLUE-coconut
Copy link
Copy Markdown
Contributor

Summary

  • Fix mmx quota show --quiet outputting reversed used/remaining values
  • The API field current_interval_usage_count returns remaining counts (not used), consistent with the model_remains wrapper name
  • Quiet mode was double-subtracting: remaining = total - usage_count, treating usage_count as "used" when it's actually "remaining"
  • The rich text table (quota-table.ts) already handled this correctly; only the quiet TSV path had the bug

Before (usage_count=1497, total=1500):

MiniMax-M*    1497    1500    3     ← columns reversed

After:

MiniMax-M*    3    1500    1497    ← correct: used=3, total=1500, remaining=1497

Fixes #53

Test plan

  • Run mmx quota show --quiet and verify used/remaining columns are correct
  • Run mmx quota show --output text and confirm rich table is unchanged
  • Run mmx quota show --output json and cross-check raw values

🤖 Generated with Claude Code

The quiet mode (--quiet) in `quota show` was treating
`current_interval_usage_count` as "used" and subtracting it from total
to get "remaining". However, the API actually returns remaining/available
counts in this field (consistent with the `model_remains` wrapper name).

This caused the TSV output columns to be reversed: what was labeled as
"remaining" was actually "used", and vice versa.

The rich text table (quota-table.ts) already handled this correctly.

Fixes MiniMax-AI#53

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

quota text output interprets *_usage_count as used, but API appears to return remaining/available

1 participant