feat(minimax): Add multi-service usage support#605
feat(minimax): Add multi-service usage support#605XWind18 wants to merge 2 commits intosteipete:mainfrom
Conversation
Implementation: - Add MiniMaxServiceUsage struct for multi-service tracking - Support Text Generation, TTS, Image, Video, and Music services - Parse API responses with service type mapping - Implement window type detection (5 hours, Today) - Add localization support (English/Chinese) - Three-window UI mapping (primary/secondary/tertiary) - Backward compatibility for legacy single-service mode Bug Fixes: - Fix minimaxAuthMode() call signature - Remove duplicate MiniMaxProviderSettings definition - Remove unused variables in MiniMaxUsageFetcher Verification: ✓ No compiler warnings ✓ Follows Swift Testing framework conventions ✓ Complies with docs/provider.md architecture
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c41b88c3fd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let payload = try MiniMaxUsageParser.decodePayload(data: data) | ||
| self.logCodingPlanStatus(payload: payload) | ||
| return try MiniMaxUsageParser.parseCodingPlanRemains(payload: payload, now: now) | ||
| let snapshot = try MiniMaxUsageParser.parseCodingPlanRemains(payload: payload, now: now) |
There was a problem hiding this comment.
Parse multi-service JSON in remains fallback path
The remains-web fallback still decodes JSON with decodePayload(data:) (legacy model_remains schema) before parsing, while multi-service support was added only in parseCodingPlanRemains(data:). If this endpoint returns the new data.services response, decoding fails immediately and the fallback fetch errors out instead of producing usage. This branch should go through the data-based parser (or try multi-service decode first) to keep fallback compatible.
Useful? React with 👍 / 👎.
- Remains-web fallback now uses parseCodingPlanRemains(data:) to support multi-service JSON responses, maintaining backward compatibility with single-service format - Settings snapshot now accepts tokenOverride parameter, enabling per-account credential injection for multi-account refresh - Remove unused logCodingPlanStatus call in fallback path Fixes code review comments for remains-web fallback and token account settings snapshot.
Summary
Add comprehensive multi-service usage support for MiniMax Provider.
What's New
Multi-Service Support
Features
Testing
27 tests across 5 suites (existing test infrastructure):
Screenshots
Menu View
Shows three services with usage stats:

Settings View
Provider configuration and region selection:

Verification