onboard(minimax): flatten auth to 4 direct choices, unify CN/Global under single provider (#44284)

Replace the multi-step MiniMax onboarding wizard with 4 flat options:
- MiniMax Global — OAuth (minimax.io)
- MiniMax Global — API Key (minimax.io)
- MiniMax CN — OAuth (minimaxi.com)
- MiniMax CN — API Key (minimaxi.com)

Storage changes:
- Unify CN and Global under provider "minimax" (baseUrl distinguishes region)
- Profiles: minimax:global / minimax:cn (both regions can coexist)
- Model ref: minimax/MiniMax-M2.5 (no more minimax-cn/ prefix)
- Remove LM Studio local mode and Lightning/Highspeed choice

Backward compatibility:
- Keep minimax-cn in provider-env-vars for existing configs
- Accept minimax-cn as legacy tokenProvider in CI pipelines
- Error with migration hint for removed auth choices in non-interactive mode
- Warn when dual-profile overwrites shared provider baseUrl

Made-with: Cursor
This commit is contained in:
liyuan97
2026-03-13 02:23:42 +08:00
committed by GitHub
parent 1492ad20a9
commit 55f47e5ce6
16 changed files with 274 additions and 435 deletions

View File

@@ -9,20 +9,6 @@ import type { ProviderConfig } from "./models-config.providers.js";
describe("models-config merge helpers", () => {
const preservedApiKey = "AGENT_KEY"; // pragma: allowlist secret
const kimiModel: ProviderConfig["models"][number] = {
id: "k2p5",
name: "Kimi for Coding",
input: ["text", "image"],
reasoning: true,
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 128_000,
maxTokens: 8_000,
};
it("refreshes implicit model metadata while preserving explicit reasoning overrides", () => {
const merged = mergeProviderModels(
@@ -83,17 +69,31 @@ describe("models-config merge helpers", () => {
it("preserves implicit provider headers when explicit config adds extra headers", () => {
const merged = mergeProviderModels(
{
baseUrl: "https://api.example.com",
api: "anthropic-messages",
baseUrl: "https://api.anthropic.com",
headers: { "User-Agent": "claude-code/0.1.0" },
models: [kimiModel],
} as ProviderConfig,
models: [
{
id: "k2p5",
name: "Kimi for Coding",
input: ["text", "image"],
reasoning: true,
},
],
} as unknown as ProviderConfig,
{
baseUrl: "https://api.example.com",
api: "anthropic-messages",
baseUrl: "https://api.anthropic.com",
headers: { "X-Kimi-Tenant": "tenant-a" },
models: [kimiModel],
} as ProviderConfig,
models: [
{
id: "k2p5",
name: "Kimi for Coding",
input: ["text", "image"],
reasoning: true,
},
],
} as unknown as ProviderConfig,
);
expect(merged.headers).toEqual({

View File

@@ -187,7 +187,7 @@ const MODELSTUDIO_MODEL_CATALOG: ReadonlyArray<ProviderModelConfig> = [
{
id: "MiniMax-M2.5",
name: "MiniMax-M2.5",
reasoning: false,
reasoning: true,
input: ["text"],
cost: MODELSTUDIO_DEFAULT_COST,
contextWindow: 1_000_000,