Fix MiniMax token plan usage display#1266
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 5, 2026, 6:09 PM ET / 22:09 UTC. Summary Reproducibility: yes. by source and report evidence, though I did not run a live MiniMax account locally. Current main lacks the new token-plan endpoint and remaining-percent quota handling, while the linked screenshots and discussion show the user-visible mismatch after MiniMax's billing change. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused token-plan parser/display repair if maintainers accept the MiniMax endpoint and auth-scope changes, and track Do we have a high-confidence way to reproduce the issue? Yes by source and report evidence, though I did not run a live MiniMax account locally. Current main lacks the new token-plan endpoint and remaining-percent quota handling, while the linked screenshots and discussion show the user-visible mismatch after MiniMax's billing change. Is this the best way to solve the issue? Yes, the current branch is a maintainable focused repair for token-plan parsing/display because it preserves legacy fallbacks and adds targeted tests. The only open solution question is whether the newer AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against acc0fc737270. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c30b7ee387
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,43 @@ | |||
| extension MiniMaxUsageSnapshot { | |||
| func withPlanNameIfAvailable(_ planName: String?) -> MiniMaxUsageSnapshot { | |||
| let cleaned = planName?.trimmingCharacters(in: .whitespacesAndNewlines) | |||
There was a problem hiding this comment.
Import Foundation before trimming plan names
This new file does not import Foundation, but trimmingCharacters(in:) and .whitespacesAndNewlines are Foundation APIs; Swift imports are file-scoped, so any target compiling this file fails before the MiniMax tests can run. Add import Foundation before using these helpers.
Useful? React with 👍 / 👎.
| if let tokenPlan = tokenPlans.min(by: { lhs, rhs in | ||
| lhs.rank == rhs.rank ? lhs.value.count < rhs.value.count : lhs.rank < rhs.rank | ||
| }) { | ||
| return tokenPlan.value |
There was a problem hiding this comment.
Prefer current plan over global token-plan strings
When the combo response contains strings for multiple token plans (for example a packages list with Plus/Max/Ultra alongside current_subscribe_title for the actual subscription), this global min ranking always chooses Plus over Max/Ultra regardless of the current plan. That mislabels Max or Ultra users as Plus; restrict the search to the current subscription fields first, or only fall back to all collected strings when no current-plan value is present.
Useful? React with 👍 / 👎.
c30b7ee to
485bd89
Compare
|
I took a quick pass at the MiniMax compatibility blocker. The red arm64 Linux check looks unrelated to this patch: it failed while Swiftly was downloading Swift 6.2.1 ( The source-side blocker is the endpoint compatibility issue ClawSweeper called out: API-token fetches now try only I prepared a small helper commit here:
What it does:
Validation: I also checked the current merge conflict locally; it appears limited to release/version files ( |
4f818f3 to
997e20e
Compare
|
Thanks @Yuxin-Qiao for the MiniMax compatibility patch and test direction. I incorporated the API-token fallback approach here. What changed:
Validation:
Full |
|
I confirmed one adjacent acceptance case from a live MiniMax console session and from a focused local test against current
The parser/token-plan direction in this PR looks aligned with the live console shape. The one small follow-up I would consider before merge is extending the automatic metric resolver to MiniMax too, with a regression case like: let snapshot = UsageSnapshot(
primary: RateWindow(usedPercent: 0, windowMinutes: 300, resetsAt: nil, resetDescription: nil),
secondary: RateWindow(usedPercent: 97, windowMinutes: 7 * 24 * 60, resetsAt: nil, resetDescription: nil),
updatedAt: Date())
#expect(MenuBarMetricWindowResolver.rateWindow(
preference: .automatic,
provider: .minimax,
snapshot: snapshot,
supportsAverage: false)?.usedPercent == 97)I verified that focused case locally on current main with |
|
Addressed the MiniMax automatic menu-bar metric follow-up. MiniMax now uses the most constrained quota window for automatic metrics, so a near-exhausted weekly lane is surfaced over a low 5h lane. Added coverage for the 5h 0% + weekly 97% case in Validation:
|
fa3b1f0 to
a67929d
Compare
|
Just closed my own #1285 (narrow If maintainers want a second pair of eyes on the boosted-quota-percent commit (1b7dfaa) once CI is green, I can do a focused review against a local checkout of this branch. Real-behavior tested on a Thanks for the thorough work here. |
|
I checked this against the current MiniMax I prepared a helper commit on top of this PR's current head (
What it changes:
Validation on the helper worktree: This is not a blocker if maintainers are comfortable with the current HTML-first fallback, but it makes the web-session path better aligned with the new MiniMax console/usage surface while keeping the old page fallback. |
|
Follow-up update on the helper branch: I pushed This adds support for the current MiniMax console usage page data path:
Local validation in this managed Codex environment: |
|
Thanks @Yuxin-Qiao for the additional MiniMax console compatibility investigation. My main goal with this PR is to restore MiniMax usage data first, since the recent MiniMax token-plan changes already broke the old parsing/display path. The current branch keeps the fix focused on token-plan parsing/display, API-token fallback, and the automatic metric behavior, and CI is green now. The newer If maintainers prefer to include the web-session compatibility follow-up in #1266, I’m happy to take a look and incorporate the minimal part needed. Otherwise, I think it may be better as a follow-up PR after this fix lands. |
490fccf to
13b2667
Compare
Try the token-plan remains endpoint first, then fall back to the legacy coding-plan remains endpoint for compatible API-token failures. Cover the new fallback path and the updated global/China retry request order.
Use the most constrained MiniMax quota window for automatic menu-bar metrics so a near-exhausted weekly lane is not hidden behind a low 5h lane.
13b2667 to
09afa2a
Compare
Summary
generalandvideobuckets.General,Video) in the MiniMax menu card.interval_boost_permill/weekly_boost_permill.generalweekly status-3 quota as unlimited, while hiding unavailable Plusvideoplaceholders.Validation
swift test --filter MiniMaxTokenPlanChangeTestsswift test --filter MiniMaxMenuCardModelPlanTestsmake checkCODEXBAR_SIGNING=adhoc ./Scripts/package_app.shNotes
swift testcurrently fails in unrelatedProviderStorageFootprintTests.swift:401withstorageRefreshGenerationexpected41, actual42.