Fix MiniMax coding-plan fetch + OpenCode Go percent scaling (fixes #246, #247) - #250
Merged
Conversation
MenuCardDetails indexed ProviderUsageSnapshot["localUsage"] after the field moved to ProviderChartData in the UI split (b167e32); providerGridUtils.test used null for a string|undefined field.
scan_codex_detailed always ran the pi-compatible sweep of the real ~/.pi and ~/.omp agent session trees, so tests injecting fixture sessions dirs got polluted by the developer machine's history (host-dependent failures). Skip the sweep when sessions dirs are overridden; production paths never set the override.
MiniMax: port the upstream cookie/web fetch (coding-plan page -> remains fallback) so coding plan quota no longer depends on the billing history endpoint that 500s; billing stays as best-effort enrichment; Auto/Web fall back to browser cookies. OpenCode Go: stop rescaling direct usagePercent values <= 1.0 to 100%; the server sends integer percent.
coding_plan.rs crossed the 1000-line bar with three responsibilities; split HTML scrape into coding_plan_html.rs. Remove RemainsRow.usage/limit + boost-permille quota plumbing computed but never consumed.
Collaborator
Author
|
Merged 🎉 Thank you @makssiful and @CarlosLongarela for the precise reports — #247 included the exact root-cause line range and live payload, #246 the browser network trace, both made the fix straightforward. The fixes ship in the next release; miniMax users hit the coding-plan fallback automatically (billing 500 no longer breaks the tray). Issues #246 and #247 close automatically with this merge; please report back after upgrading. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
MiniMax billing returned status 500)What changed
MiniMax (#246) — the cookie/web path depended solely on the billing-history endpoint (
/account/amount), which returns HTTP 500 for coding-plan accounts. Ported the upstream cookie/web fetch: coding-plan page (/user-center/payment/coding-plan?cycle_type=3) → JSON /__NEXT_DATA__/ visible-text HTML scrape →coding_plan/remainsfallback chain (platform host, then www host; retry only on 404/405/network/parse). Billing history stays as best-effort enrichment — its failure, including the reported 500, no longer kills the fetch. Auto/Web now fall back to browser cookies when no manual cookie is set (same convention as the other web providers).1004/login strings map to AuthRequired. Parser lives inminimax/coding_plan.rs(JSON/remains) +minimax/coding_plan_html.rs(HTML scrape), upstream-formula parity withMiniMaxUsageFetcher.swift.OpenCode Go (#247) —
extract_window()scaled direct percent fields ≤ 1.0 by 100 ("fraction heuristic"), turning the server's integerusagePercent: 1into a false 100% / "Exhausted Weekly". Removed the scaling; direct percent fields pass through (upstreamparseSubscriptionparity). Regression test uses the reporter's exact$R[...]payload.Main repairs included (separate tiny commits, were breaking CI at HEAD): TS build fix from the UI split (
MenuCardDetails/providerGridUtils.test), and hermetic cost-scan tests (skip the real-home pi session sweep when tests inject sessions roots). Full detail in commit bodies.Validation
rust/full suite: 848 lib + 1 bin, 0 failedcargo clippyboth crates-D warnings;cargo fmt --checkcleanscripts\local-check.ps1: exit 0 — Local checks passed.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.