fix: report unavailable quota models#205
Merged
NianJiuZst merged 1 commit intoJul 18, 2026
Merged
Conversation
NianJiuZst
marked this pull request as ready for review
July 18, 2026 17:56
NianJiuZst
self-requested a review
July 18, 2026 17:56
NianJiuZst
reviewed
Jul 18, 2026
NianJiuZst
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
not in planinstead of100%/unlimitedRoot 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.tsbun run typecheckbun run lint(no errors; two pre-existing warnings)bun testbun run build:devFixes #173
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.