Skip to content

fix: report unavailable quota models#205

Merged
NianJiuZst merged 1 commit into
MiniMax-AI:mainfrom
shaoohh:agent/fix-quota-unavailable-plan
Jul 18, 2026
Merged

fix: report unavailable quota models#205
NianJiuZst merged 1 commit into
MiniMax-AI:mainfrom
shaoohh:agent/fix-quota-unavailable-plan

Conversation

@shaoohh

@shaoohh shaoohh commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect the zero-allocation sentinel returned for models that are not included in the current Token Plan
  • render both quota windows as not in plan instead of 100% / unlimited
  • suppress the misleading reset countdown for unavailable models
  • keep the existing weekly-unlimited behavior when only the weekly window has status 3

Root cause

The quota API reuses status 3 for two different states. A normal model can have an unlimited weekly window, while an unavailable model is returned with both totals set to zero and both current and weekly statuses set to 3. The renderer treated every weekly status 3 as unlimited, so the video row described in the issue looked usable even though generation was rejected as 0/0.

Impact

Users now see that a model is not part of their plan before attempting a generation request, instead of being told that it has full or unlimited quota.

Validation

  • bun test test/output/quota-table.test.ts
  • bun run typecheck
  • bun run lint (no errors; two pre-existing warnings)
  • bun test
  • bun run build:dev

Fixes #173


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@NianJiuZst
NianJiuZst marked this pull request as ready for review July 18, 2026 17:56
@NianJiuZst
NianJiuZst self-requested a review July 18, 2026 17:56

@NianJiuZst NianJiuZst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This fixes a real user-facing inconsistency: the quota API can return the zero-allocation sentinel for a model excluded from the current plan, while the existing renderer incorrectly presents weekly status 3 as unlimited. The guard is narrowly scoped, preserves the legitimate weekly-unlimited case, and passes the focused and full test suites, so this looks good to merge once the GitHub Actions workflows are approved and green.

@NianJiuZst
NianJiuZst merged commit 6621c82 into MiniMax-AI:main Jul 18, 2026
3 checks passed
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.

mmx quota show reports 100% remaining for video, but mmx video generate rejects with 0/0 used

2 participants