Skip to content

feat: add MiniMax Coding Plan quota provider#33

Merged
slkiser merged 3 commits intoslkiser:mainfrom
Zuz666:feat/minimax-coding-plan
Apr 1, 2026
Merged

feat: add MiniMax Coding Plan quota provider#33
slkiser merged 3 commits intoslkiser:mainfrom
Zuz666:feat/minimax-coding-plan

Conversation

@Zuz666
Copy link
Copy Markdown
Contributor

@Zuz666 Zuz666 commented Mar 30, 2026

Refs #32

Summary

  • Adds src/lib/minimax-auth.ts: credential resolution from OpenCode auth.json with validation and caching
  • Adds src/providers/minimax-coding-plan.ts: fetches rolling 5-hour and weekly quota from GET https://api.minimax.io/v1/api/openplatform/coding_plan/remains, normalizes into QuotaToastEntry for both classic and grouped toast styles
  • Adds src/lib/types.ts: MiniMaxAuthData, MiniMaxResult, MiniMaxResultEntry types
  • Updates src/providers/registry.ts: registers minimaxCodingPlanProvider
  • Updates tests/quota-provider-boundary.test.ts: adds minimax-coding-plan to the registry snapshot
  • Adds tests/lib.minimax-auth.test.ts: 15 tests covering credential resolution (none, configured, invalid type, empty key, cached)
  • Adds tests/providers.minimax-coding-plan.test.ts: 26 tests covering classic/grouped entries, worst-window selection, error mapping, matchesCurrentModel, isAvailable, API success/failure/401/network error/bad JSON/unexpected shape
  • Updates README.md: adds MiniMax Coding Plan to provider list, setup table, and provider-specific notes

Behaviour

  • Provider id: minimax-coding-plan
  • Auto-detected when OpenCode is configured with the minimax-coding-plan provider
  • Credential resolution from: OpenCode auth.json minimax-coding-plan section (API key)
  • Classic style: shows the worse of the two windows
  • Grouped style: shows both MiniMax Coding Plan 5h and MiniMax Coding Plan Weekly entries
  • Graceful errors on missing credentials, 401/403, network failure, malformed API responses

Checks

  • npm run typecheck OK
  • npm test OK (MiniMax tests: 41 pass; 26 pre-existing Windows-only failures unrelated to this change)
  • npm run build OK

Add minimax-coding-plan provider that fetches rolling 5-hour
and weekly quota windows from the MiniMax API for MiniMax-M*
text models. Credentials are resolved from OpenCode auth.json.

- src/lib/minimax-auth.ts: credential resolution
- src/providers/minimax-coding-plan.ts: quota fetch + entries
- src/providers/registry.ts: provider registration
- tests/lib.minimax-auth.test.ts: 15 auth tests
- tests/providers.minimax-coding-plan.test.ts: 26 provider tests
- Updated README with MiniMax setup and provider notes
@Zuz666 Zuz666 force-pushed the feat/minimax-coding-plan branch from b2577e4 to 6e06e34 Compare March 30, 2026 22:38
@slkiser slkiser merged commit 11030d5 into slkiser:main Apr 1, 2026
3 checks passed
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.

2 participants