Skip to content

fix(minimax): improve session bucket selection and CN path handling#472

Draft
FrankieeW wants to merge 10 commits into
robinebers:mainfrom
FrankieeW:feat/minimax-plugin-refresh
Draft

fix(minimax): improve session bucket selection and CN path handling#472
FrankieeW wants to merge 10 commits into
robinebers:mainfrom
FrankieeW:feat/minimax-plugin-refresh

Conversation

@FrankieeW
Copy link
Copy Markdown
Contributor

@FrankieeW FrankieeW commented May 18, 2026

Summary

  • Extend session bucket detection to cover M2.7, M2.7-highspeed, minimax_m naming patterns
  • Apply session bucket selection to both GLOBAL and CN paths (previously GLOBAL-only)
  • Remove incorrect 5h Coding Plan assumption from inferRemainsMs comment
  • Add regression test for CN path with companion bucket appearing first

Test plan

  • npm test passes (1094 total, 60 minimax)
  • No breaking changes to provider output format
  • Backward compatible with existing usage patterns

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

    • Show Session as percent, not counts; companion buckets (TTS HD/Turbo, image-01) stay as counts with chars/images.
    • Detect session buckets for M2.7/M2.7-highspeed/minimax_m and prefer the session entry even if it isn’t first (GLOBAL and CN).
    • Infer plans from model-call limits and companion quotas; normalize to Starter/Plus/Max/Plus-High-Speed/Max-High-Speed/Ultra-High-Speed with a (CN)/(GLOBAL) suffix.
    • Use daily windows for companion buckets when only remains_time is present.
  • Bug Fixes

    • Apply session bucket selection to CN responses and update CN primary endpoint to https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains with fallbacks.
    • Improve remains_time handling: pick seconds vs ms correctly, favor ms when it matches end_time, respect 5h (Token Plan) vs 24h (daily) windows, and handle overflow.
    • Rename “Coding Plan” to “Token Plan” across code and docs.

Written for commit d97cf84. Summary will update on new commits. Review in cubic

- 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
Copilot AI review requested due to automatic review settings May 18, 2026 00:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 isSessionUsageName patterns (m2.7, minimax_m) and apply orderRemainItemsForDisplay in CN path.
  • Update inferRemainsMs to accept an explicit expectedWindowMs and 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.

Comment thread README.md
- [**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
@FrankieeW FrankieeW marked this pull request as draft May 18, 2026 00:41
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Re-trigger cubic

FrankieeW added 3 commits May 18, 2026 01:47
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants