Skip to content

MiniMax: quota utilization history and reset-time display#1983

Open
Yuxin-Qiao wants to merge 4 commits into
steipete:mainfrom
Yuxin-Qiao:feat/minimax-quota-utilization
Open

MiniMax: quota utilization history and reset-time display#1983
Yuxin-Qiao wants to merge 4 commits into
steipete:mainfrom
Yuxin-Qiao:feat/minimax-quota-utilization

Conversation

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor

Summary

Split from #1821 (PR C). Merge after #1981 (can land in parallel with the dashboard PR).

  • Record MiniMax Session / Weekly quota utilization samples
  • Subscription Utilization submenu (Codex-style chart)
  • Menu bar nearest reset window for MiniMax
  • MenuBarMetricWindowResolver nearest-reset helper

Test plan

  • swift build
  • swift test --filter UsageStorePlanUtilization
  • swift test --filter MenuBarResetTimeDisplay

Merge order

  1. MiniMax: Token Plan recharge credits and web session enrichment #1981 (credits + web enrichment)
  2. This PR

Made with Cursor

Yuxin-Qiao and others added 2 commits July 8, 2026 11:29
Add token_plan_credit enrichment for cookie-backed refreshes, MiniMax Agent
desktop cookie import, API-token web enrichment resolver, and menu credit display.

Co-authored-by: Cursor <cursoragent@cursor.com>
Record Session and Weekly quota samples, show subscription utilization charts,
and prefer the nearest MiniMax reset window in the menu bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codex review: needs changes before merge. Reviewed July 8, 2026, 12:31 AM ET / 04:31 UTC.

Summary
Adds MiniMax recharge-credit and web-session enrichment, Session/Weekly quota utilization history, subscription-utilization chart support, nearest reset-time display, docs, and tests.

Reproducibility: yes. for the review findings from source inspection: current main has a percent-mode merged Codex countdown scheduling test, and the PR now returns before that path can schedule. The Codex credits hint regression is also source-reproducible through Model.make with a Codex projection, nil credits, and nil creditsError.

Review metrics: 2 noteworthy metrics.

  • Diff Size: 42 files, +2905/-292. The PR is broad enough that provider auth, menu UI, docs, and tests all need review before merge.
  • Security-Sensitive Surface: 8 MiniMax auth/enrichment files touched. Cookie import, endpoint override, web enrichment, and API-token enrichment changes are merge-relevant beyond ordinary UI tests.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦪 silver shellfish
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The current head would stop scheduling Codex menu-bar refreshes for exhausted-lane reset transitions outside reset-time countdown mode, so percent and merged highest-usage displays can remain stale after reset.
  • [P1] The current head would show the Codex credits-unavailable hint whenever optional credits are absent and no credits error exists, contrary to the projection path that keeps optional setup diagnostics out of the glanceable card.
  • [P1] This PR is stacked with MiniMax web-session and MiniMax Agent cookie enrichment from MiniMax: Token Plan recharge credits and web session enrichment #1981, so merging out of order would land credential-source and endpoint behavior together with quota-history UI.
  • [P1] The MiniMax auth surface expands to manual/env cookies, cached/browser cookies, MiniMax Agent desktop cookies, and a new endpoint override; green tests do not by themselves settle the security-boundary and upgrade decision.

Maintainer options:

  1. Repair Codex Regressions And Rebase After The Prerequisite (recommended)
    Restore Codex countdown scheduling and silent no-credits behavior, then refresh the branch after MiniMax: Token Plan recharge credits and web session enrichment #1981 so the remaining quota diff is reviewable.
  2. Accept The Stacked MiniMax Auth Surface
    Maintainers can intentionally merge the stacked branch, but they should own the credential-source and endpoint-override upgrade risk explicitly.
  3. Close In Favor Of A Narrow Split
    If the stacked auth surface is not worth carrying here, close this PR and ask for a quota-history/reset-time-only replacement after the prerequisite settles.

Next step before merge

  • [P2] Two concrete Codex regressions are mechanically repairable on the PR branch; maintainer approval is still needed for the stacked MiniMax credential-boundary decision after repair.

Maintainer decision needed

  • Question: Should this PR be allowed to carry the MiniMax web-session and MiniMax Agent cookie enrichment, or should those credential-boundary changes land only through MiniMax: Token Plan recharge credits and web session enrichment #1981 first?
  • Rationale: The code can be mechanically repaired, but accepting automatic MiniMax desktop-cookie enrichment and the stacked merge order is a maintainer security/product boundary decision.
  • Likely owner: Peter Steinberger — Peter has the strongest combined history on MiniMax provider behavior, release state, and the current menu-bar countdown file.
  • Options:
    • Keep Credential Changes In Prerequisite (recommended): Review or land MiniMax: Token Plan recharge credits and web session enrichment #1981 first, then rebase this PR so quota history and reset-time UI are separable from auth plumbing.
    • Accept The Stacked Boundary: Allow this PR to carry the credential-source changes too, but require explicit upgrade/security review before merge.
    • Ask For A Narrower PR: Pause this branch and request a fresh quota-history-only PR if maintainers do not want the stacked auth surface here.

Security
Cleared: No concrete supply-chain or credential-leak bug was found in the diff, but the MiniMax cookie/session expansion is security-sensitive and remains a merge-risk decision.

Review findings

  • [P1] Preserve Codex reset refresh scheduling — Sources/CodexBar/StatusItemController+CountdownRefresh.swift:23-28
  • [P2] Keep silent Codex cards silent when credits are absent — Sources/CodexBar/MenuCardView+Costs.swift:49
Review details

Best possible solution:

Preserve existing Codex menu-bar and card behavior, keep the MiniMax credential-boundary work aligned with #1981, then land the quota-history/reset UI with focused regression coverage.

Do we have a high-confidence way to reproduce the issue?

Yes for the review findings from source inspection: current main has a percent-mode merged Codex countdown scheduling test, and the PR now returns before that path can schedule. The Codex credits hint regression is also source-reproducible through Model.make with a Codex projection, nil credits, and nil creditsError.

Is this the best way to solve the issue?

No for the current head: the MiniMax feature direction is useful, but the patch should preserve existing Codex projection behavior and keep the credential-boundary stack aligned with the prerequisite PR. The safer path is a small repair on this branch plus maintainer review of the auth surface.

Full review comments:

  • [P1] Preserve Codex reset refresh scheduling — Sources/CodexBar/StatusItemController+CountdownRefresh.swift:23-28
    Late catch: this guard now returns for percent/both modes before the Codex projection's nextMenuBarStateChangeAt can be considered. Current main has MenuBarCountdownRefreshTests.merged highest usage observes reset for noncurrent Codex candidate with menuBarDisplayMode = .percent; with this change that path never schedules, so exhausted Codex lanes can remain visible past reset in merged/highest-usage menu-bar mode.
    Confidence: 0.94
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Keep silent Codex cards silent when credits are absent — Sources/CodexBar/MenuCardView+Costs.swift:49
    Late catch: by dropping the Codex-specific nil guard, a normal Codex model with no optional credits snapshot and no credits error falls through to the descriptor hint Credits unavailable; keep Codex running to refresh. StatusItemController intentionally passes creditsError = nil for Codex projections so optional credit setup diagnostics do not dominate the glanceable card; restore the Codex no-data nil case.
    Confidence: 0.91
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aa401f1d8b74.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority provider feature PR with concrete merge blockers and limited blast radius before release.
  • merge-risk: 🚨 compatibility: The PR changes existing Codex menu-bar and card behavior while also relying on a stacked MiniMax prerequisite merge order.
  • merge-risk: 🚨 auth-provider: The diff changes MiniMax API-token routing, cookie candidate selection, web-session enrichment, and group-id handling.
  • merge-risk: 🚨 security-boundary: The diff adds automatic MiniMax Agent desktop cookie import and new cookie-authenticated web endpoint requests.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): The linked split parent provides live MiniMax Plus screenshots for the utilization UI and redacted CLI output for the same web-session enrichment stack, so no additional contributor proof is required for this review cycle.
  • proof: sufficient: Contributor real behavior proof is sufficient. The linked split parent provides live MiniMax Plus screenshots for the utilization UI and redacted CLI output for the same web-session enrichment stack, so no additional contributor proof is required for this review cycle.
Evidence reviewed

Acceptance criteria:

  • [P1] swift test --filter MenuBarCountdownRefreshTests.
  • [P1] swift test --filter MenuCardModelCodexProjectionTests.
  • [P1] swift test --filter MiniMaxResetDescriptionTests.
  • [P1] swift test --filter UsageStorePlanUtilizationTests.
  • [P1] make check.

What I checked:

  • Repository policy read: AGENTS.md was read fully; its provider/auth, Keychain, and focused-test guidance applies because this PR touches MiniMax credential discovery and menu UI. (AGENTS.md:1)
  • Diff scope: The PR changes 42 files with 2905 additions and 292 deletions, including MiniMax provider fetch/auth helpers, menu-bar reset display, utilization storage, docs, and tests. (9cf14abfe4e6)
  • Codex countdown refresh regression: The PR returns early unless the menu bar is in reset-time countdown mode, so the current-main Codex projection reset refresh path is no longer considered for percent/merged highest-usage displays. (Sources/CodexBar/StatusItemController+CountdownRefresh.swift:23, 9cf14abfe4e6)
  • Current-main test expectation: Current main has a focused test that sets merged highest-usage mode with menuBarDisplayMode percent and expects a Codex reset refresh to be scheduled for a noncurrent Codex candidate. (Tests/CodexBarTests/MenuBarCountdownRefreshTests.swift:156, aa401f1d8b74)
  • Codex credits fallback regression: The PR removes the Codex-specific no-data nil guard, so absent optional credits with no error falls through to the descriptor hint instead of staying quiet. (Sources/CodexBar/MenuCardView+Costs.swift:49, 9cf14abfe4e6)
  • Codex projection intentionally suppresses optional credit diagnostics: Current main passes creditsError as nil for Codex projections so optional credits/browser setup diagnostics do not dominate the glanceable card. (Sources/CodexBar/StatusItemController+MenuCardModel.swift:46, aa401f1d8b74)

Likely related people:

  • Peter Steinberger: Introduced the MiniMax provider and appears in recent/current MiniMax provider, fallback, billing, and countdown/menu-bar history. (role: recent area contributor; confidence: high; commits: 17cdc54b26fa, 7ffad6b5a4bf, af202b462bdf; files: Sources/CodexBarCore/Providers/MiniMax/MiniMaxProviderDescriptor.swift, Sources/CodexBar/StatusItemController+CountdownRefresh.swift, Sources/CodexBar/MenuCardView+Costs.swift)
  • Yuxin Qiao: Prior merged MiniMax token-plan, diagnostics, billing, and quota-display work makes this person relevant beyond authoring the current PR. (role: MiniMax feature contributor; confidence: high; commits: d00c6c0f523d, bde4290fe771, 78c8c0b2bd08; files: Sources/CodexBarCore/Providers/MiniMax, Tests/CodexBarTests/MiniMaxProviderTests.swift, Tests/CodexBarTests/UsageStorePlanUtilizationTests.swift)
  • XWind: Prior MiniMax multi-service, metadata, API-token fallback, and token-plan display commits are adjacent to the changed provider logic. (role: MiniMax provider contributor; confidence: medium; commits: 77b7367c9bd7, 90368202df70, 3298e47f74aa; files: Sources/CodexBarCore/Providers/MiniMax)
  • Ratul Sarna: Introduced and refactored the Codex consumer projection/menu-bar account behavior that the countdown and credits regressions now intersect. (role: Codex projection feature owner; confidence: medium; commits: c0df637e4b70, f7e7e933d160, d41be3a95326; files: Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift, Sources/CodexBar/MenuCardView+Costs.swift)
  • Shengqiang Zhang: Recent combined menu-bar metric refactors are adjacent to the Codex projection menu-bar behavior this PR regresses. (role: recent menu-bar contributor; confidence: medium; commits: 7c4f86bd74ca, d2690d4176b3; files: Sources/CodexBar/StatusItemController+Animation.swift, Sources/CodexBar/Providers/Codex/CodexConsumerProjection.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-08T03:45:42.981Z sha a568631 :: needs changes before merge. :: [P1] Restore the debug-aware button title overload | [P2] Keep the browser cooldown expectation aligned with the gate

Move menuBarResetTimeWindow into the countdown refresh extension.

Co-authored-by: Cursor <cursoragent@cursor.com>
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Jul 8, 2026
Restore now-parameter signatures, debug button titles, and Codex combined-lane
selection while keeping MiniMax-specific reset-time routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant