Skip to content

MiniMax: show token plan period end#1110

Closed
Yuxin-Qiao wants to merge 2 commits into
steipete:mainfrom
Yuxin-Qiao:minimax-plan-period-end-display
Closed

MiniMax: show token plan period end#1110
Yuxin-Qiao wants to merge 2 commits into
steipete:mainfrom
Yuxin-Qiao:minimax-plan-period-end-display

Conversation

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor

Fixes or follows up MiniMax Token Plan display.

Summary

  • Adds MiniMax-only planPeriodEndsAt to MiniMaxUsageSnapshot.
  • Derives it from MiniMax model_remains end_time.
  • Displays conservative UI copy: "Plan period ends: Jun 22, 2026".
  • Does not reuse or overload resetsAt.
  • Does not touch ProviderCostSnapshot.
  • Does not touch Claude/Cursor/OpenAI/OpenRouter.
  • Does not change provider fetch cadence or menu bar behavior.

Validation

  • swift test --filter MiniMax (59 tests)
  • swift test --filter MenuCard (72 tests)
  • make check (0 violations)
  • git diff --check (clean)

Files

  • Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift
  • Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift
  • Sources/CodexBar/MenuCardView+MiniMax.swift
  • Tests/CodexBarTests/MiniMaxProviderTests.swift
  • Tests/CodexBarTests/MiniMaxMenuCardModelPlanTests.swift

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-22 17:01 UTC / May 22, 2026, 1:01 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The branch adds a MiniMax-only planPeriodEndsAt field, threads nil defaults through MiniMax parsing paths, preserves it across billing-summary copies, and adds parser/menu tests that keep the plan-period UI hidden unless the field is populated.

Reproducibility: yes. for the review finding: source inspection of PR head shows the new field is documented as endTime-derived while parser paths leave it nil and new tests assert end_time must not populate it. I did not run builds or tests because this is a read-only review.

PR rating
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Summary: The PR is not quality-ready because real behavior proof is still absent and the remaining patch publishes a contradictory plan-period contract.

Rank-up moves:

  • Remove or correct the planPeriodEndsAt source/display documentation so it matches the parser and tests.
  • Update the PR body to match the latest scope after the UI/source removal.
  • Add redacted real MiniMax runtime proof, such as a menu screenshot or terminal/log output, after the contract is fixed.
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.

Real behavior proof
Needs real behavior proof before merge: The PR body/comments list tests and checks, but no redacted screenshot, recording, terminal/live output, linked artifact, or runtime log shows the changed MiniMax behavior after the latest head; contributors should redact private data and update the PR body to trigger re-review.

Risk before merge

  • The branch exposes a plan-period property while every parser path intentionally leaves it nil, so maintainers need to decide whether this future-prep API should land before a reliable MiniMax billing-period source exists.
  • The field documentation still names MiniMaxModelRemains.endTime as the source even though the new tests say end_time is quota reset data, which could guide a future implementation back to the wrong source.
  • The contributor has listed test commands but has not provided redacted runtime proof from a MiniMax setup after the latest fix.

Maintainer options:

  1. Decide the mitigation before merge
    Either remove the dormant plan-period field until a reliable MiniMax billing-period source is identified, or keep it only with documentation/tests that clearly state it is intentionally unset today and add runtime proof for the chosen behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
Contributor revision and real MiniMax proof are needed; automation cannot supply account-specific runtime evidence, and maintainers should decide whether the dormant API belongs before a real billing-period source exists.

Security
Cleared: The diff only touches MiniMax provider model/parser/menu-card code and tests, with no dependency, script, secret-handling, workflow, or artifact-source changes.

Review findings

  • [P2] Fix the plan-period source contract — Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:14-16
Review details

Best possible solution:

Either remove the dormant plan-period field until a reliable MiniMax billing-period source is identified, or keep it only with documentation/tests that clearly state it is intentionally unset today and add runtime proof for the chosen behavior.

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

Yes for the review finding: source inspection of PR head shows the new field is documented as endTime-derived while parser paths leave it nil and new tests assert end_time must not populate it. I did not run builds or tests because this is a read-only review.

Is this the best way to solve the issue?

No; the latest head no longer implements the advertised display and leaves a misleading public contract behind. The narrower maintainable path is to remove or accurately document the dormant field until a true billing-period source exists.

Label justifications:

  • P2: This is a normal provider feature/API cleanup with limited blast radius, but the current PR still has a concrete contract mismatch before merge.
  • rating: 🧂 unranked krab: Current PR rating is 🧂 unranked krab because proof is 🧂 unranked krab, patch quality is 🦪 silver shellfish, and The PR is not quality-ready because real behavior proof is still absent and the remaining patch publishes a contradictory plan-period contract.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body/comments list tests and checks, but no redacted screenshot, recording, terminal/live output, linked artifact, or runtime log shows the changed MiniMax behavior after the latest head; contributors should redact private data and update the PR body to trigger re-review.

Full review comments:

  • [P2] Fix the plan-period source contract — Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift:14-16
    The new public field is documented as derived from MiniMaxModelRemains.endTime and intended for display, but this same branch no longer sets it from any parser and adds tests asserting end_time must leave planPeriodEndsAt nil. Merging this would publish a misleading MiniMax billing-period contract; either remove the dormant field for now or update the contract to say it is intentionally unset until a real billing-period source exists.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.86

Acceptance criteria:

  • swift test --filter MiniMax
  • swift test --filter MenuCard
  • make check
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: The MiniMax provider appears to date to commit 17cdc54, and commit af202b4 added MiniMax billing summaries in the same provider snapshot/fetcher area; shortlog also shows the heaviest MiniMax-area history. (role: feature introducer and recent area contributor; confidence: high; commits: 17cdc54b26fa, af202b462bdf; files: Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageSnapshot.swift, Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Tests/CodexBarTests/MiniMaxProviderTests.swift)
  • Yuxin-Qiao: Beyond this PR, commit 645ca83 changed MiniMax remains-to-used mapping and quota-style menu cards in the same fetcher/menu/test surface. (role: recent area contributor; confidence: high; commits: 645ca833df31; files: Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Sources/CodexBar/MenuCardView+MiniMax.swift, Tests/CodexBarTests/MiniMaxProviderTests.swift)
  • XWind: Commit 77b7367 added MiniMax multi-service usage support, which is adjacent to the menu-card services path and parser behavior this PR extends. (role: multi-service feature contributor; confidence: medium; commits: 77b7367c9bd7; files: Sources/CodexBarCore/Providers/MiniMax/MiniMaxUsageFetcher.swift, Sources/CodexBar/MenuCardView+MiniMax.swift)

Codex review notes: model gpt-5.5, reasoning high; reviewed against cdb6acba6407.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels May 22, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@Yuxin-Qiao Yuxin-Qiao force-pushed the minimax-plan-period-end-display branch from 1a09cb4 to 8f30369 Compare May 22, 2026 16:33
@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

ClawSweeper feedback addressed in follow-up push.

Changes:

  • Removed the model_remains.end_time -> planPeriodEndsAt mapping.
  • Confirmed end_time is treated as MiniMax quota interval reset, not billing/plan-period end.
  • weeklyEndTime is not used.
  • planPeriodEndsAt now remains nil unless a reliable MiniMax billing/plan-period source is found later.
  • Removed the "Plan period ends" menu card row because there is no reliable billing-period source yet, and the previous Metric(percent: 0) rendering was misleading.
  • Kept the MiniMax-only planPeriodEndsAt field as conservative future preparation only.
  • Did not touch ProviderCostSnapshot.
  • Did not touch Claude/Cursor/OpenAI/OpenRouter.

Validation:

  • swift test --filter MiniMax: 58 tests passed, exit 0
  • swift test --filter MenuCard: 71 tests passed, exit 0
  • make check: 0 violations, exit 0
  • git diff --check: clean

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

CI follow-up:

The failing lint-build-test job is not a lint failure and does not appear related to the MiniMax patch.

What passed:

  • SwiftFormat/SwiftLint: 0 violations
  • GitGuardian: pass
  • build-linux-cli x64: pass
  • build-linux-cli arm64: pass

The only failure is in the macOS Swift Test step during test discovery:

python3 Scripts/ci_swift_test_by_suite.py --group-size 1 --timeout 120

The script fails before running suites because:

swift test list

returns non-zero on the macOS 15 Intel runner with Xcode 26.1.1.

This looks like a CI environment / SwiftPM test-discovery failure rather than a source-code or MiniMax-patch failure.

No source files were changed for this diagnosis.

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

CI blocker fixed.

Root cause: MenuCardView+MiniMax.swift had a stray return metrics after the plan-period metric row was removed and the function was changed back to returning services.enumerated().map { ... }.

Fix: Removed the stale return metrics. No plan-period UI row was reintroduced.

Validation:

  • swift test list: passed
  • swift test --filter MiniMax: 58 tests passed
  • swift test --filter MenuCard: 71 tests passed
  • make check: 0 violations
  • git diff --check: clean

Scope:

  • Only MiniMax menu-card source touched.
  • No ProviderCostSnapshot changes.
  • No Claude/Cursor/OpenAI/OpenRouter changes.

@steipete
Copy link
Copy Markdown
Owner

Thanks for chasing this. I do not think this PR should land in its current shape.

After the follow-up, the implementation no longer shows a MiniMax plan-period end. The new tests explicitly assert that model_remains.end_time must not be treated as a billing-period end, and the parser keeps planPeriodEndsAt nil. That correction is right, but it means the remaining production change is an unused optional field plus preservation coverage, not the feature described by the title/body.

I am going to close this one rather than merge a no-op data-model field. A follow-up would be welcome if MiniMax exposes a real billing-period source distinct from quota reset time.

@steipete steipete closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants