fix(minimax): fall back to remaining_percent when count fields are zero#172
Closed
ASF-E-OBJECTTOOBIG wants to merge 1 commit into
Closed
fix(minimax): fall back to remaining_percent when count fields are zero#172ASF-E-OBJECTTOOBIG wants to merge 1 commit into
ASF-E-OBJECTTOOBIG wants to merge 1 commit into
Conversation
MiniMax's international Coding Plan API now returns current_interval_total_count: 0 and current_interval_usage_count: 0 for the general/video rows, with usage carried in current_interval_remaining_percent and current_weekly_remaining_percent. The previous parser dropped any record with total <= 0, surfacing "no reportable MiniMax Coding Plan quota" on /quota and /quota_status. - Add getPercentRemaining accessor to each entry in MINIMAX_WINDOW_SPECS. - Rewrite buildMiniMaxEntry to fall back to the percent field when count fields are missing or zero. The count-based path is unchanged. - Relax isMiniMaxModelRecord to accept records with current_interval_remaining_percent even when count fields are absent. Closes the follow-up to the model-name fix in v3.11.1 (general/video matching).
slkiser
pushed a commit
that referenced
this pull request
Jul 22, 2026
Owner
|
Thanks for the fix and validation. This was integrated into v4.0.1, including the remaining-percentage fallback for zero-count MiniMax responses. Closing this PR as completed. |
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
MiniMax's international Coding Plan endpoint now returns
current_interval_total_count: 0/ current_interval_usage_count: 0for thegeneralandvideorows, with actual usage carried incurrent_interval_remaining_percent/current_weekly_remaining_percent(pluscurrent_*_status` for limit state).The current parser drops any record with
total <= 0, so affected users seeno reportable MiniMax Coding Plan quota.This is the follow-up to #150 — that fix added the
general/videomodel-name match but assumed counts would still be populated. This PR:getPercentRemainingaccessor to each entry inMINIMAX_WINDOW_SPECSreadingcurrent_interval_remaining_percent/current_weekly_remaining_percent.buildMiniMaxEntryso that when count fields are missing/zero, it falls back to the percent field instead of returningnull. The count-based path is preserved unchanged for any response shape that still populates totals.isMiniMaxModelRecordto accept a record withcurrent_interval_remaining_percenteven when count fields are absent, hardening against further API drift.The percent path reuses the existing
roundPercenthelper, matching upstream's "negative percentages allowed" contract.Linked Issue
Fixes #171
OpenCode Validation
dist/providers/minimax-coding-plan.js(v3.11.2) confirmed/quota_statusnow reportsfive_hour_usage: 14% remainingandweekly_usage: 10% remainingfor the user's actual MiniMax API payload.Quality Checklist
pnpm run typecheckpnpm testpnpm run buildREADME.mdandCONTRIBUTING.mdwhen applicable)contributing/provider-template/or explained why the template does not apply.tstemplate incontributing/provider-template/and verifiedREADME.mdagainstsrc/lib/provider-metadata.ts(authentication/authFallbacks) and provider auth resolver/diagnostics behavior