Implement reserve for Xiaomi MiMo plan
Now that Xiaomi reduced their prices significantly, Xiaomi will become more and more popular. Can the feature from other providers showing how we are tracking against the reserve be added to Xiaomi plan, too?
Codex review: this still needs some work. Reviewed October 2, 2026, 4:01 PM ET / 20:01 UTC.
Summary MiMo pacing is already shipped, but its monthly assumption conflicts with the accepted cadence contract. The owner explicitly requests keeping this issue open until that policy is resolved.
Reproducibility: not applicable. as a feature-policy request: source and the window test establish the shipped monthly mapping, but no live annual-plan failure was reproduced.
Root-cause cluster
Relationship: canonical
Canonical: https://github.com/steipete/codexbar/issues/1205
Summary: This issue remains the owner-designated location for resolving MiMo cadence policy after implementation.
Members:
partial_overlap: https://github.com/steipete/codexbar/pull/1809 - Merged the evidence contract and explicitly retained this issue for evidence and implementation.partial_overlap: https://github.com/steipete/codexbar/pull/2526 - Merged reserve-capable monthly mapping but did not resolve authoritative cadence or annual-plan correctness.partial_overlap: https://github.com/steipete/codexbar/pull/1310 - Closed unmerged proposal used period-end inference that the later evidence brief rejected.
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Maintainer decision needed
| Question | Recommendation |
|---|---|
| Should MiMo restore unknown-cadence suppression, or should its shipped monthly assumption explicitly supersede the accepted evidence contract? | Restore the evidence contract: Suppress MiMo pacing for unknown cadence while retaining usage and period-end display until authoritative monthly and annual evidence exists. |
Why: Both paths have owner involvement, and the latest owner comment leaves the conflict unresolved; changing shipped pacing requires an explicit choice.
Next step Resolve the owner-reserved cadence policy before commissioning a runtime repair; this repository profile also disables automatic closure.
Review details
Best possible solution:
Use shared reserve calculations only for an authoritative token-reset window, preserving usage and period-end display when cadence remains unknown.
Do we have a high-confidence way to reproduce the issue?
Not applicable as a feature-policy request: source and the window test establish the shipped monthly mapping, but no live annual-plan failure was reproduced.
Is this the best way to solve the issue?
Unclear until the owner resolves cadence policy; an unconditional monthly inference lacks the evidence required by the accepted brief.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- Subscription period end may differ from token-credit reset cadence; annual plans can receive misleading monthly reserve or deficit estimates.
Codex review notes: model internal, reasoning medium; reviewed against 29ae87e25231.
Label changes
Label changes:
- add
issue-rating: 🌊 off-meta tidepool: Current issue advisory state selects this label. - remove
issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label. - remove
clawsweeper:source-repro: Current issue advisory state no longer selects this label.
Label justifications:
P2: This is a bounded provider-display policy conflict without evidence of blocked setup or core runtime failure.impact:other: Unproven cadence can mislead users about token-plan reserve and consumption forecasts.
Evidence reviewed
What I checked:
- Current implementation: A positive token limit and any planPeriodEnd produce a 43200-minute sentinel; the MiMo descriptor enables calendar-month pacing. (
Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift:65, 29ae87e25231) - Cadence is not established by the parser: Token-plan detail decoding retains planCode, currentPeriodEnd, and expired. It supplies no authoritative start, duration, or token-reset cadence to the usage window. (
Sources/CodexBarCore/Providers/MiMo/MiMoUsageFetcher.swift:327, 29ae87e25231) - Accepted evidence contract: The merged brief requires unknown cadence to keep windowMinutes nil, rejects inference from subscription validity, and requires annual-plan token-reset evidence. https://github.com/steipete/CodexBar/pull/1809 merged this contract without implementing reserve reporting. (
docs/superpowers/specs/2026-07-01-mimo-reserve-decision.md:67, 29ae87e25231) - Implementation provenance: GitHub verifies https://github.com/steipete/CodexBar/pull/2526 merged as this commit. Its patch adds the MiMo sentinel, calendar-month capability, and window test; its author login is LeoLin990405. The owner's follow-up completed the shared history and pacing routes. (
Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift, 3c34bcbd1c31) - Shipped behavior: The v0.71.0 snapshot contains the same sentinel mapping, and git tag containment includes v0.71.0. The release endpoint confirms publication on October 2, 2026. This establishes shipped behavior, not annual-plan correctness. (
Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift:65, cb5f0cbe8861) - Explicit owner disposition: The September 23 owner comment acknowledges implemented pacing but explicitly keeps the issue open for monthly-assumption versus authoritative-cadence policy: https://github.com/steipete/CodexBar/issues/1205#issuecomment-5787348999. The earlier live API investigation remains useful evidence: https://github.com/steipete/CodexBar/issues/1205#issuecomment-4582508433.
Likely related people:
- steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- LeoLin990405: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- Yuxin-Qiao: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
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-reviewcomments, 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-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto 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 explainto ask for more context, or@clawsweeper stopto stop active automation.
I checked this with a temporary Xiaomi MiMo Token Plan membership and collected redacted structural proof from the live API.
The live /tokenPlan/detail response exposes:
- planCode
- planName
- currentPeriodEnd
- expired
- enableAutoRenew
- autoRenewDiscount
- hasAutoRenewSubscribed
It does not expose any of the period/window fields I looked for:
- no currentPeriodStart
- no periodStart
- no startDate
- no periodDays
- no windowDays
- no duration
- no billingCycle
- no resetCycle
The live /tokenPlan/usage response exposes token usage data:
- monthUsage.items[].used
- monthUsage.items[].limit
- monthUsage.items[].percent
- usage.items[].used
- usage.items[].limit
- usage.items[].percent
So MiMo currently gives CodexBar enough data for usedPercent and resetsAt, but not enough data to compute windowMinutes without assuming a billing window.
I also have local characterization tests documenting the current behavior:
- MiMo windowMinutes remains nil
- resetsAt maps from planPeriodEnd
- usedPercent maps from token percent × 100
- generic weekly pacing returns nil without windowMinutes
- MiMo session pace text remains unsupported
Given that the live API does not expose period-start or duration data, should this remain characterization-only for now, or would you prefer a product decision to assume a monthly window for MiMo pacing?
PR #1310
I would go with monthly only for now.
I took another look at this after #1310 was closed. The blocker still seems to be cadence confidence: MiMo exposes usage and currentPeriodEnd, but not an authoritative period start or duration.
Would it be useful to keep this blocked on a redacted annual-plan /tokenPlan/detail + /tokenPlan/usage sample? A future implementation could then enable pace only for reliably identified monthly plans and leave windowMinutes nil for unknown or ambiguous cadence, including annual plans in their final month.
I prepared a bounded decision brief in draft PR #1809. Recommendation: preserve MiMo's current fail-closed behavior and do not infer a 30/31-day reserve window from period-end proximity, plan validity, price, or plan-name text.
The observed response has usage percentage and period end but no start, duration, or cadence discriminator. Monthly and annual plans therefore cannot be distinguished safely, especially during an annual plan's final month. The draft documents alternatives, required redacted monthly/annual proof, regression cases, and the exact contract needed to enable shared reserve/deficit text.
Keeping this issue open for maintainer sign-off or an authoritative token-credit reset source.
That accepted fail-closed contract is no longer what main does. #2526 deliberately added a 30-day sentinel whenever planPeriodEnd is present and enabled .calendarMonthResetWindow; the maintainer follow-up explicitly completed that path, although MiMo was only verified by construction and the PR's live proof covered StepFun.
I don't think a revert is safe until we settle which decision supersedes the other. Should #1205 restore windowMinutes == nil and remove MiMo calendar-month pacing until Xiaomi exposes cadence, or is #2526 now the intended policy despite the annual-plan ambiguity? A fail-closed repair would only touch MiMoUsageSnapshot, MiMoProviderDescriptor, and the MiMo window test.
Current main already enables MiMo pacing through #2526 (3c34bcbd1c31), and the existing window test requires a monthly sentinel whenever a period end is present. That still conflicts with the accepted fail-closed cadence brief: the parser does not establish period start or token-reset cadence. The tests verify the shipped mapping, not whether it is correct for annual plans. Please keep this open until the monthly-assumption versus authoritative-cadence policy is resolved. Thanks @LeoLin990405 for the implementation and @Yuxin-Qiao for the earlier API investigation.
Thanks @AdrianSimionov. Xiaomi MiMo exposes no plan/reserve API; the MiMo provider reads what the console shows. Closing as not actionable.