fix(minimax): improve session bucket selection and CN path handling#472
Draft
FrankieeW wants to merge 10 commits into
Draft
fix(minimax): improve session bucket selection and CN path handling#472FrankieeW wants to merge 10 commits into
FrankieeW wants to merge 10 commits into
Conversation
- Extend isSessionUsageName to match M2.7, M2.7-highspeed, minimax_m patterns - Rename pickGlobalSessionRemainItem to pickSessionRemainItem for CN reuse - Apply session bucket selection to both GLOBAL and CN paths (was GLOBAL only) - Remove unused endpointSelection parameter from classifyUsageEntry - Update inferRemainsMs comment to reflect actual behavior (not just 5h Coding Plan) - Add regression test for CN path with companion bucket appearing first Fixes PR robinebers#317 review comments on session bucket selection
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up to PR #317 fixing MiniMax plugin issues: expanding the session-bucket detection patterns, applying session-bucket selection to CN (not just GLOBAL), correcting a stale comment in inferRemainsMs, and adding a CN regression test.
Changes:
- Extend
isSessionUsageNamepatterns (m2.7,minimax_m) and applyorderRemainItemsForDisplayin CN path. - Update
inferRemainsMsto accept an explicitexpectedWindowMsand drop the inaccurate "Coding Plan resets every 5h" assumption. - Add CN-region regression test asserting the session entry is picked when a companion bucket appears first.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates MiniMax bullet to mention model-calls and CN TTS/image buckets. |
| docs/providers/minimax.md | Documents new model-calls display, six-tier plan naming, CN endpoint, and companion-resource lines. |
| plugins/minimax/plugin.json | Adds detail-scope lines for TTS HD/Turbo, Image Generation, and image-01. |
| plugins/minimax/plugin.js | Refactors parser to emit multiple resource entries, infer plans via companion quotas, normalize CN endpoint order, and parameterize inferRemainsMs window. |
| plugins/minimax/plugin.test.js | Adds extensive new tests for CN/GLOBAL companion buckets, session ordering, plan inference, and remains_time handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - [**Kiro**](docs/providers/kiro.md) / credits, bonus credits, overages | ||
| - [**Kimi Code**](docs/providers/kimi.md) / session, weekly | ||
| - [**MiniMax**](docs/providers/minimax.md) / coding plan session | ||
| - [**MiniMax**](docs/providers/minimax.md) / coding plan session model-calls, CN TTS/image buckets |
Update all references from CODING_PLAN_* constants to TOKEN_PLAN_* for consistency with MiniMax API rename. Also normalize "MiniMax Coding Plan" to "Token Plan" alongside existing "token plan" handling.
Add 8 new tests covering: - M2.7 and M2.7-highspeed session bucket classification - speech-hd and image-01 NOT classified as session - session bucket selected by name pattern, not order (GLOBAL + CN) - 5h token-plan window for session remains_time inference - daily window for non-session companion buckets Also fix isSessionUsageName to include highspeed pattern per official docs.
Session bucket now displays usage as percentage (used/limit*100) with limit normalized to 100, matching plugins/claude and plugins/codex style. Companion buckets (speech-hd, image-01) remain as counts. Companion bucket assertions updated to use actual API values.
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
Test plan
Related
Fixes PR #317 review comments
Summary by cubic
Improves the MiniMax plugin’s session detection and plan inference, unifies GLOBAL/CN behavior, and switches to Token Plan terminology. Session usage now shows as a percentage (0–100) with companion resource buckets and correct reset windows.
New Features
image-01) stay as counts withchars/images.minimax_mand prefer the session entry even if it isn’t first (GLOBAL and CN).(CN)/(GLOBAL)suffix.remains_timeis present.Bug Fixes
remains_timehandling: pick seconds vs ms correctly, favor ms when it matchesend_time, respect 5h (Token Plan) vs 24h (daily) windows, and handle overflow.Written for commit d97cf84. Summary will update on new commits. Review in cubic