Repository navigation
feat(chat): add MiniMax models to the model picker - #5538
octo-patch wants to merge 2 commits into
Conversation
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit cbc3ef0 on Jul 13, 2026 9:48am UTC. |
📝 WalkthroughWalkthroughThis PR adds MiniMax support across shared model catalogs, desktop model pickers, provider logo mapping, CloudModelProvider runtime credentials, tests, and provider configuration documentation for global and China API regions. ChangesMiniMax provider support
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds MiniMax-M3 to the Superset chat model catalog (
Confidence Score: 4/5Safe to merge; changes are additive catalog entries with no logic modification to existing paths. All five changed files are straightforward additions — a new model entry, a matching dev-mode entry, a logo routing constant, and a test. The only gap is that MINIMAX_LOGO_PROVIDER is not re-exported from the two barrel index.ts files, leaving it inaccessible via the public import path that ANTHROPIC_LOGO_PROVIDER and OPENAI_LOGO_PROVIDER use. Both providerToLogo/index.ts files should be updated to re-export MINIMAX_LOGO_PROVIDER.
|
| Filename | Overview |
|---|---|
| packages/shared/src/agent-models.ts | Adds MiniMax-M3 as the first entry in SUPERSET_CHAT_MODELS; AGENT_MODEL_SUPPORT picks it up automatically via the map. |
| packages/shared/src/agent-models.test.ts | Adds a targeted test asserting MiniMax-M3 appears in the superset picker model list. |
| apps/desktop/src/renderer/lib/dev-chat.ts | Adds MiniMax-M3 to the dev-mode chat model list, keeping it in sync with SUPERSET_CHAT_MODELS. |
| apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts | Adds MINIMAX_LOGO_PROVIDER constant and a minimax routing check; constant is not re-exported from the barrel index.ts. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatPane/components/WorkspaceChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts | Identical change to the v2-workspace copy of providerToLogo; same barrel omission applies. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Model picker renders provider group] --> B{providerToLogo}
B -->|includes 'minimax'| C[MINIMAX_LOGO_PROVIDER = 'minimax']
B -->|includes 'anthropic'/'claude'| D[ANTHROPIC_LOGO_PROVIDER]
B -->|includes 'openai'/'gpt'/o3/codex| E[OPENAI_LOGO_PROVIDER]
B -->|other| F[pass-through slug]
C --> G[ModelSelectorLogo provider='minimax']
D --> H[claudeIcon img]
E --> I[ModelSelectorLogo provider='openai']
G --> J[isConnected = true, modelDisabled = false]
H --> K[isConnected = isAnthropicAuthenticated]
I --> L[isConnected = isOpenAIAuthenticated]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Model picker renders provider group] --> B{providerToLogo}
B -->|includes 'minimax'| C[MINIMAX_LOGO_PROVIDER = 'minimax']
B -->|includes 'anthropic'/'claude'| D[ANTHROPIC_LOGO_PROVIDER]
B -->|includes 'openai'/'gpt'/o3/codex| E[OPENAI_LOGO_PROVIDER]
B -->|other| F[pass-through slug]
C --> G[ModelSelectorLogo provider='minimax']
D --> H[claudeIcon img]
E --> I[ModelSelectorLogo provider='openai']
G --> J[isConnected = true, modelDisabled = false]
H --> K[isConnected = isAnthropicAuthenticated]
I --> L[isConnected = isOpenAIAuthenticated]
Reviews (1): Last reviewed commit: "Add MiniMax-M3 to Superset chat models" | Re-trigger Greptile
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts (1)
1-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsider extracting shared
providerToLogoto avoid duplicate maintenance.This file is an exact duplicate of the
WorkspaceChatInterfaceproviderToLogo.ts. Both copies now carry the identical MiniMax mapping, meaning any future provider addition must be applied in two places. Extracting a single shared utility would eliminate this maintenance burden.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts` around lines 1 - 25, The providerToLogo logic is duplicated between this ModelPicker utility and WorkspaceChatInterface, so any provider mapping changes must be maintained in two places. Refactor by extracting a single shared providerToLogo helper (and the provider slug constants like ANTHROPIC_LOGO_PROVIDER, OPENAI_LOGO_PROVIDER, and MINIMAX_LOGO_PROVIDER) and have both components import it, keeping the existing mapping behavior intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts`:
- Around line 1-25: The providerToLogo logic is duplicated between this
ModelPicker utility and WorkspaceChatInterface, so any provider mapping changes
must be maintained in two places. Refactor by extracting a single shared
providerToLogo helper (and the provider slug constants like
ANTHROPIC_LOGO_PROVIDER, OPENAI_LOGO_PROVIDER, and MINIMAX_LOGO_PROVIDER) and
have both components import it, keeping the existing mapping behavior intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6b517c49-0951-4271-a94e-2004f60e51b3
📒 Files selected for processing (5)
apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.tsapps/desktop/src/renderer/lib/dev-chat.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatPane/components/WorkspaceChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.tspackages/shared/src/agent-models.test.tspackages/shared/src/agent-models.ts
There was a problem hiding this comment.
No issues found across 5 files
Architecture diagram
sequenceDiagram
participant User
participant Picker as ModelPicker Component
participant LogoUtil as providerToLogo()
participant Catalog as Agent Model Catalog
participant DevModels as Dev Chat Models
participant ChatSvc as Chat Service
participant Backend as Backend API
Note over Picker,Catalog: Model Picker Opening
User->>Picker: open dropdown
alt Production
Picker->>Catalog: get SUPERSET_CHAT_MODELS
Catalog-->>Picker: [..., {id:"minimax/MiniMax-M3", provider:"MiniMax"}, ...]
else Development
Picker->>DevModels: get DEV_CHAT_MODELS
DevModels-->>Picker: [..., {id:"minimax/MiniMax-M3", provider:"MiniMax"}, ...]
end
Note over Picker,LogoUtil: User selects model
User->>Picker: select MiniMax-M3
Picker->>LogoUtil: providerToLogo("MiniMax")
LogoUtil-->>Picker: "minimax"
Note over Picker: displays minimax logo slug
Note over Picker,Backend: User sends message
User->>Picker: send chat message
Picker->>ChatSvc: startChat(model="minimax/MiniMax-M3", message)
ChatSvc->>Backend: POST /chat { model, message }
Backend-->>ChatSvc: response / stream
ChatSvc-->>User: reply messages
|
Updated this PR to include MiniMax-M3 and MiniMax-M2.7 for both API regions, forward the runtime API key, and document both supported protocols. I ran Biome, 27 targeted tests, and mocked request URL captures for all four endpoint variants. |
There was a problem hiding this comment.
1 issue found across 8 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.test.ts">
<violation number="1" location="packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.test.ts:1">
P2: Test's afterEach cleanup is incomplete — prepareRuntimeEnv() can delete other cloud provider env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) from process.env without restoring them. Since the envResolver only returns MINIMAX_API_KEY, applyRuntimeEnv will delete any other CLOUD_PROVIDER_ENV_KEYS that happen to be set. Consider snapshotting and restoring the full set of affected env vars, or using a before/after wrapper that captures all CLOUD_PROVIDER_ENV_KEYS.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| @@ -0,0 +1,24 @@ | |||
| import { afterEach, describe, expect, it } from "bun:test"; | |||
There was a problem hiding this comment.
P2: Test's afterEach cleanup is incomplete — prepareRuntimeEnv() can delete other cloud provider env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) from process.env without restoring them. Since the envResolver only returns MINIMAX_API_KEY, applyRuntimeEnv will delete any other CLOUD_PROVIDER_ENV_KEYS that happen to be set. Consider snapshotting and restoring the full set of affected env vars, or using a before/after wrapper that captures all CLOUD_PROVIDER_ENV_KEYS.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.test.ts, line 1:
<comment>Test's afterEach cleanup is incomplete — prepareRuntimeEnv() can delete other cloud provider env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) from process.env without restoring them. Since the envResolver only returns MINIMAX_API_KEY, applyRuntimeEnv will delete any other CLOUD_PROVIDER_ENV_KEYS that happen to be set. Consider snapshotting and restoring the full set of affected env vars, or using a before/after wrapper that captures all CLOUD_PROVIDER_ENV_KEYS.</comment>
<file context>
@@ -0,0 +1,24 @@
+import { afterEach, describe, expect, it } from "bun:test";
+import { CloudModelProvider } from "./CloudModelProvider";
+
</file context>
Reason: add target provider/model to existing provider registry
Summary
Test plan
bunx @biomejs/biome@2.4.2 check packages/shared/src/agent-models.ts packages/shared/src/agent-models.test.ts apps/desktop/src/renderer/lib/dev-chat.ts packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.ts packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.test.tsbun test packages/shared/src/agent-models.test.ts packages/host-service/src/providers/model-providers/CloudModelProvider/CloudModelProvider.test.ts apps/desktop/src/renderer/lib/dev-chat.test.ts