Add MiniMax provider support - #349
Conversation
Contributor License AgreementThe following contributors need CLA coverage: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 700d574. Configure here.
| if (typeof options.apiKey === "string") saveUserSettings({ apiKey: options.apiKey, provider }); | ||
| else if (typeof options.provider === "string" || (typeof options.model === "string" && modelProvider)) { | ||
| saveUserSettings({ provider }); | ||
| } |
There was a problem hiding this comment.
Provider switch reuses stale API key
High Severity
Saving only provider while leaving the existing apiKey in place lets getApiKey treat the previous provider’s credential as valid for the newly selected provider. After a --provider or model-driven switch without a fresh key, later runs can authenticate MiniMax with an xAI key (or the reverse) and fail auth or hit the wrong API.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 700d574. Configure here.
| this.abortController = null; | ||
| } | ||
| return; | ||
| } |
There was a problem hiding this comment.
Rejected image stays in history
Medium Severity
The unsupported-image guard pushes the user message into this.messages and returns without discarding it. On text-only models such as MiniMax-M2.7, later turns still include that image payload and can fail even after the user retries with plain text.
Reviewed by Cursor Bugbot for commit 700d574. Configure here.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |


Reason: Add MiniMax OpenAI-compatible provider support with regional endpoints, current model metadata, and capability-aware behavior.
This change:
Checks:
bun run lint(passes with existing warnings)bun run typecheckbunx vitest run src/providers/minimax.test.ts src/grok/models.test.ts src/grok/client.test.ts src/grok/media.test.ts src/agent/batch-mode.test.ts src/audio/stt/grok-stt.test.ts src/utils/subagents-settings.test.ts src/telegram/bridge.test.tsbunx vitest run --exclude src/storage/sessions.test.tsbun run buildbun run src/index.ts --helpbun run src/index.ts modelsThe unfiltered Vitest run still encounters the repository's existing
bun:sqlitemodule-loading limitation insrc/storage/sessions.test.ts; the remaining 48 test files and 251 tests pass.Note
Medium Risk
Touches core agent initialization, credential resolution, and all inference paths (interactive, headless, Telegram, delegations). Capability checks reduce blast radius for unsupported APIs, but wrong provider/model pairing or env settings could still confuse users or break sessions until configured correctly.
Overview
Introduces a pluggable provider layer (
ProviderAdapterwith xAI and MiniMax adapters) and wires MiniMax as a second backend alongside xAI.MiniMax is selected via
--provider minimax,GROK_PROVIDER=minimax, or inferred from model IDs. It uses@ai-sdk/openai-compatibleagainst regional endpoints (MINIMAX_REGION,MINIMAX_BASE_URL), registers MiniMax-M3 and MiniMax-M2.7 metadata, and defaults chat to MiniMax-M3 when that provider is active.Capability gating blocks or short-circuits features MiniMax does not expose: batch API, hosted web/X search, image/video generation, Telegram STT, and image input when the model lacks image modality—while local CLI tools and chat completions remain available.
Agent, CLI, TUI, Telegram bridge, and settings now resolve API keys, base URLs, models, sub-agents, and titles/recaps per active provider; cross-provider model selection is rejected at runtime.
Reviewed by Cursor Bugbot for commit 700d574. Configure here.