Skip to content

Expand MiniMax Token Plan multi-model remains + menu sections#1

Draft
cskeleton wants to merge 67 commits into
mainfrom
cursor/minimax-multi-model-usage-ef73
Draft

Expand MiniMax Token Plan multi-model remains + menu sections#1
cskeleton wants to merge 67 commits into
mainfrom
cursor/minimax-multi-model-usage-ef73

Conversation

@cskeleton
Copy link
Copy Markdown
Owner

Summary

  • Decode full model_remains[] from MiniMax coding plan remains API into MiniMaxUsageSnapshot.models (MiniMaxModelUsage), including optional weekly fields and model identifiers (model_name, model_type, model_id, name/title).
  • Keep existing scalar snapshot fields + toUsageSnapshot() primary behavior (first row) unchanged for menu bar icon.
  • Menu card: grouped sections (5-hour / daily / weekly / other) with per-row progress + optional weekly secondary line when weekly quota fields are present.
  • Docs: docs/minimax.md section on multi-model mapping.

Commands run

  • swift build (Linux)
  • swift test (Linux — runs TestsLinux only; CodexBarTests is macOS-gated in Package.swift)
  • pnpm check failed: SwiftFormat download script could not extract swiftformat binary from archive (environment issue)

Notes

  • Please run on macOS before merge: swift test (full suite), swiftformat + swiftlint --strict, ./Scripts/compile_and_run.sh as per AGENTS.md.
Open in Web Open in Cursor 

steipete and others added 30 commits April 18, 2026 19:06
Co-authored-by: c.skeleton <cskeleton@users.noreply.github.com>
Gemini token refresh failed when the CLI was installed via fnm because
CodexBar only looked for OAuth client credentials in legacy oauth2.js
paths under node_modules.

fnm installs can expose Gemini through fnm_multishells symlinks and
bundle the CLI into bundle/gemini.js plus hashed chunk files, so neither
the Node version directory nor the chunk filename is stable enough to
hardcode.

Update Gemini OAuth credential discovery to:
- keep the cheap legacy oauth2.js path reads as the primary lookup
- detect fnm-managed paths and resolve the active Gemini package root
  via fnm
- support bundled CLI layouts by following bundle imports instead of
  assuming fixed chunk names
- bound the directory walk-up so an unrelated Gemini install elsewhere
  on the host cannot contaminate discovery started from the actual
  binary path

Also add API tests covering the legacy layouts and the fnm bundle
layout so expired-token refresh works across both installation styles.
…ent cache self-destruction on wake

When the keychain is temporarily locked (e.g. immediately after wake from
sleep), SecItemCopyMatching returns errSecInteractionNotAllowed (-25308).
Previously this fell into the default case, returned .invalid, and the
caller deleted the cache entry — causing every wake from sleep to require
a fresh read of "Claude Code-credentials", which triggers a keychain
prompt.

Two changes:
1. Apply KeychainNoUIQuery to the cache load query so the call never
   blocks waiting for UI interaction (consistent with how other no-UI
   reads are done elsewhere in the codebase).
2. Add an explicit case for errSecInteractionNotAllowed that returns
   .missing instead of .invalid — the entry is valid, just temporarily
   inaccessible, so it should not be deleted.
…e.aliyun.com

- Change consoleRPCBaseURLString from bailian-beijing-cs.aliyuncs.com to
  bailian-cs.console.aliyun.com (the old domain causes TLS errors)
- Update consoleSite from BAILIAN_CONSOLE to BAILIAN_ALIYUN to match
  actual browser request payload
- Add new domain to cookie importer allowlist and test stub
Parse Synthetic's current quota response (rollingFiveHourLimit,
weeklyTokenLimit, search.hourly) in addition to the legacy pack
format, and surface weekly credit regeneration pacing in the menu
card. Keep slot identity stable so a missing lane never promotes
another lane into the wrong UI label, and rebuild the countdown
at render time so it doesn't freeze between snapshot refreshes.
Drop the hardcoded 5% rolling-tick assumption: thread the API's
tickPercent through SyntheticQuotaEntry into RateWindow.nextRegenPercent
and require it in syntheticRollingRegenDetail. Also flatten the string
window-suffix matcher into a single longest-first list so future units
can't shadow each other.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e mismatch and port/token handling

The URLSessionDelegate TLS challenge methods used `@Sendable` completionHandler but Swift 6.2 SDK
requires `@MainActor @Sendable`, causing the delegate to never be called. This made all HTTPS
connections to Antigravity's self-signed localhost server fail silently, falling back to the HTTP
extension port which uses a different CSRF token and doesn't serve the quota API — resulting in
misleading "session expired" (403) or "HTTP 404" errors.

Fixes:
- Switch delegate methods to async variants to match the current SDK protocol signature
- Extract `--extension_server_csrf_token` from process args and use it for HTTP extension port fallback
- Rank port probe results (success > httpError > unreachable) so a 403 on the extension port
  doesn't shadow a working API port

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Providers tab sidebar was clipping provider names, icons, and reorder
handles on the left edge due to .listStyle(.sidebar) imposing internal
leading insets that push content beyond the 240px frame on macOS Tahoe.

- Replace List with ScrollView+VStack for full control over sidebar layout
- Add direct NSWindow.setFrame resizing since SwiftUI's
  .windowResizability(.contentSize) doesn't propagate frame changes
- Add PreferencesTab.title and CaseIterable to eliminate hardcoded tab
  title strings in the window finder
- Use system selectedContentBackgroundColor for sidebar selection highlight
- Add ensure_swift_version() to compile_and_run.sh for Xcode toolchain
  fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Show full MiniMax Token Plan API usage in menu bar card and provider settings; hide weekly cap rows when the plan has no weekly limit (legacy plans).\n- MiniMax menu card: section collapse defaults, in-card scrolling, layout metrics; Preferences mirrors grouped sections with scrolling.\n- Extend MiniMaxUsageFetcher parsing, tests, and docs/minimax.md; note behavior in AGENTS.md.

Made-with: Cursor
Resolve conflicts: keep upstream async URLSession challenge handlers; use waitForResult in OpenAIDashboardNavigationDelegateTests.

Made-with: Cursor
- AppGroupSupportTests: override snapshot URLs with temp paths so migration tests do not touch real Group Containers.\n- Move ClickToCopy overlay types to MenuCardClickToCopy.swift to satisfy SwiftLint file_length.

Made-with: Cursor
Avoid treating missing remaining as zero (full usage). Show em dash over total when neither current nor remaining is available. Adds XCTest coverage. Addresses Codex review on PR steipete#742.

Made-with: Cursor
steipete and others added 30 commits April 21, 2026 00:54
* Add Claude Design and Routines usage bars

* Polish Claude labels and OpenAI cookie access errors

* Prefer populated alias over null in OAuth extra usage decoding

Per Codex review on PR #1: decodeWindowWithSource returned on the first
matching key in the payload even when its value was null, so a response
with seven_day_design: null followed by seven_day_omelette: {...} picked
the null alias and rendered a 0% bar. Scan all aliases, prefer a populated
one, and fall back to the first null-valued key only to keep the bar
visible when the API returns a known key with null payload.

* Fix Claude usage lint cleanup

* Drop OpenAI cookie import changes

* Place Claude Sonnet bar before extras

---------

Co-authored-by: Ratul Sarna <ratulsarna@gmail.com>
* fix(ui): align menu card width with menu accessories

* fix(scripts): detect signing identities correctly

* fix(menu): prevent wrapped status text from widening menu

* fix: fail on ambiguous signing identities and rebuild stale-width menus

* fix(menu): remove reserved accessory gutter

* fix(scripts): revert signing identity changes

* fix(menu): align hosted submenus with parent width
Added clear information of the automatic copy/paste of device codes which maybe missed due to window load. This should make things slightly clearer.
Co-Authored-By: Ye Hui <39940860+huiye98@users.noreply.github.com>
* Resolve merge conflicts: keep both Perplexity and Mistral providers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use Gregorian calendar for billing queries and register Mistral in token-account catalog

Address PR steipete#607 review: use fixed Gregorian/UTC calendar so non-Gregorian
system calendars don't produce wrong month/year for the Mistral billing API,
and add the missing .mistral entry to TokenAccountSupportCatalog so token-
account overrides and manual cookie mode work correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(mistral): surface monthly cost as detail text in card and CLI

UsageFormatter.resetLine prefers resetsAt over resetDescription, so the
"€X.XXXX this month" string on the primary window was never rendered.
ProviderCostSnapshot with limit=0 was also dropped by providerCostSection.

Wire Mistral through the existing Warp/Kilo/Alibaba pattern that routes
primary.resetDescription into a detail line below the bar, in both the
menu card and the CLI renderer. Drop the dead providerCost payload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix Mistral Linux build

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ratul Sarna <ratulsarna@gmail.com>
Resolve conflict in StatusItemController+Menu by remeasuring both menu cards and overview rows using rendered menu width; restore valid YAML front matter in docs/minimax.md.

Made-with: Cursor
Resolve the post-merge sizing regression by using instance-based remeasurement during menu refresh, so long MiniMax usage content can collapse correctly and the menu window shrinks as expected.

Made-with: Cursor
Keep MiniMax progress unknown when interval usage counts are missing, and suppress overview row selection when users tap in-card controls like section collapse buttons.

Made-with: Cursor
Make model-remains row IDs collision-safe for SwiftUI diffing and compute MiniMax menu scroll caps from the menu/status-item display screen instead of global NSScreen.main.

Made-with: Cursor
Preserve unsuffixed model identifiers for lookup compatibility while appending #n only when duplicate IDs appear within the same payload.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.