Skip to content

feat(chat): add MiniMax models to the model picker - #5538

Closed
octo-patch wants to merge 2 commits into
ParadevAI:mainfrom
octo-patch:octo/20260708-add-minimax-m3-recvoLikEyyR5v
Closed

octo-patch wants to merge 2 commits into
ParadevAI:mainfrom
octo-patch:octo/20260708-add-minimax-m3-recvoLikEyyR5v

Conversation

@octo-patch

@octo-patch octo-patch commented Jul 9, 2026 •

Copy link
Copy Markdown

Reason: add target provider/model to existing provider registry

Summary

  • Add MiniMax-M3 and MiniMax-M2.7 to the global and China Superset chat catalogs.
  • Forward the MiniMax API key through the cloud host runtime and keep both regional provider labels on the MiniMax logo slug.
  • Document both API regions and the Anthropic-compatible and OpenAI-compatible endpoints.

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.ts
  • bun 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
  • Captured the generated request URLs with mocked fetch for both protocols in both API regions.

Open in Stage

@ghost

ghost commented Jul 9, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Register MiniMax models in shared catalog
2 Enable MiniMax API key resolution
3 Map MiniMax provider to branding logos
4 Integrate MiniMax into UI and documentation
Open in Stage

Chapters generated by Stage for commit cbc3ef0 on Jul 13, 2026 9:48am UTC.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

MiniMax provider support

Layer / File(s) Summary
Model catalog and validation
packages/shared/src/agent-models.ts, packages/shared/src/agent-models.test.ts, apps/desktop/src/renderer/lib/dev-chat.ts
Adds MiniMax M3 and M2.7 entries for global and China endpoints, with tests covering Superset model support.
Runtime credentials and setup
packages/host-service/src/providers/model-providers/CloudModelProvider/*, apps/docs/content/docs/providers.mdx
Adds MINIMAX_API_KEY runtime handling and documents regional Anthropic-compatible and OpenAI-compatible configuration.
Provider logo mapping
apps/desktop/.../providerToLogo/*, apps/desktop/.../WorkspaceChatInterface/.../providerToLogo/*
Adds and re-exports the MiniMax logo slug and maps matching provider names to it.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: texpobros1984

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: adding MiniMax models to the chat model picker.
Description check ✅ Passed It covers the change summary and test plan, but omits Related Issues, Type of Change, Screenshots, and Additional Notes sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds MiniMax-M3 to the Superset chat model catalog (SUPERSET_CHAT_MODELS), the desktop dev model list, and both copies of the providerToLogo utility, with a corresponding test assertion.

  • agent-models.ts: MiniMax-M3 inserted as the first entry; the superset AGENT_MODEL_SUPPORT entry picks it up automatically via .map.
  • dev-chat.ts: Matching entry added so the dev-mode picker stays in sync with the shared catalog.
  • Both providerToLogo.ts copies: new MINIMAX_LOGO_PROVIDER = \"minimax\" constant and an early-return routing check added before the Anthropic branch.

Confidence Score: 4/5

Safe 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.

Important Files Changed

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]
Loading
%%{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]
Loading

Reviews (1): Last reviewed commit: "Add MiniMax-M3 to Superset chat models" | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts (1)

1-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider extracting shared providerToLogo to avoid duplicate maintenance.

This file is an exact duplicate of the WorkspaceChatInterface providerToLogo.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

📥 Commits

Reviewing files that changed from the base of the PR and between 7780dd6 and d5f92c2.

📒 Files selected for processing (5)
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts
  • apps/desktop/src/renderer/lib/dev-chat.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatPane/components/WorkspaceChatInterface/components/ModelPicker/utils/providerToLogo/providerToLogo.ts
  • packages/shared/src/agent-models.test.ts
  • packages/shared/src/agent-models.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

Re-trigger cubic

@octo-patch octo-patch changed the title Add MiniMax-M3 to chat model picker feat(chat): add MiniMax models to the model picker Jul 13, 2026
@octo-patch

Copy link
Copy Markdown
Author

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@Kitenite

Copy link
Copy Markdown
Member

Closing: main already ships this. legacy Chat/ModelPicker deleted in 8f2753b (#6461); every touched file gone. Thanks for the PR; if you think the shipped version misses a case, open an issue and link this.

@Kitenite Kitenite closed this Aug 22, 2026
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