Skip to content

fix: correct quota quiet output calculation for misleading API field naming (#70)#87

Closed
raylanlin wants to merge 1 commit intoMiniMax-AI:mainfrom
raylanlin:fix/quota-field-naming
Closed

fix: correct quota quiet output calculation for misleading API field naming (#70)#87
raylanlin wants to merge 1 commit intoMiniMax-AI:mainfrom
raylanlin:fix/quota-field-naming

Conversation

@raylanlin
Copy link
Copy Markdown
Contributor

Summary

Fixes #70 — the API returns current_interval_usage_count as the remaining count, not the used count. The table rendering (quota-table.ts) already handles this correctly, but the --quiet output was computing it backwards.

Changes

  • src/commands/quota/show.ts: Fix quiet output calculation: used = total - remaining instead of remaining = total - usage_count
  • src/output/quota-table.ts: Add clarifying comment explaining the misleading API field naming
  • src/types/api.ts: Add @deprecated JSDoc notes on the two misleading field names

Impact

Users relying on mmx quota show --quiet tab-separated output were getting the used count in the 'remaining' position. This is now corrected.

The text table rendering (mmx quota show) was already correct — this change only affects the machine-parseable quiet mode output.

…naming (MiniMax-AI#70)

The API returns current_interval_usage_count as the REMAINING count,
not the used count. The table rendering (quota-table.ts) already
handled this correctly, but the quiet output (--quiet flag) was
computing it backwards.

- src/commands/quota/show.ts: fix quiet output to correctly compute
  used = total - remaining
- src/output/quota-table.ts: add clarifying comment
- src/types/api.ts: add JSDoc deprecation notes on misleading fields
@raylanlin
Copy link
Copy Markdown
Contributor Author

Closing — API field naming issue is already being addressed by the team (元鹤). Once the API returns correctly named fields (e.g. remaining_count), the CLI quiet output logic will be updated accordingly.

@raylanlin raylanlin closed this Apr 11, 2026
@raylanlin raylanlin deleted the fix/quota-field-naming branch April 11, 2026 16:53
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.

bug: quota API response field naming is misleading — usage_count actually means remaining count

1 participant