mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 11:44:58 +00:00
Configure: label MiniMax API-key auth methods
This commit is contained in:
29
src/commands/auth-choice-options.test.ts
Normal file
29
src/commands/auth-choice-options.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { AuthProfileStore } from "../agents/auth-profiles.js";
|
||||
import { buildAuthChoiceGroups } from "./auth-choice-options.js";
|
||||
|
||||
const EMPTY_STORE: AuthProfileStore = { version: 1, profiles: {} };
|
||||
|
||||
describe("buildAuthChoiceGroups", () => {
|
||||
it("labels MiniMax non-OAuth options as API-Key", () => {
|
||||
const { groups } = buildAuthChoiceGroups({
|
||||
store: EMPTY_STORE,
|
||||
includeSkip: false,
|
||||
});
|
||||
const minimaxGroup = groups.find((group) => group.value === "minimax");
|
||||
|
||||
expect(minimaxGroup).toBeDefined();
|
||||
expect(minimaxGroup?.options.find((opt) => opt.value === "minimax-portal")?.label).toContain(
|
||||
"OAuth",
|
||||
);
|
||||
expect(minimaxGroup?.options.find((opt) => opt.value === "minimax-api")?.label).toContain(
|
||||
"API-Key",
|
||||
);
|
||||
expect(
|
||||
minimaxGroup?.options.find((opt) => opt.value === "minimax-api-key-cn")?.label,
|
||||
).toContain("API-Key");
|
||||
expect(
|
||||
minimaxGroup?.options.find((opt) => opt.value === "minimax-api-lightning")?.label,
|
||||
).toContain("API-Key");
|
||||
});
|
||||
});
|
||||
@@ -285,15 +285,15 @@ const BASE_AUTH_CHOICE_OPTIONS: ReadonlyArray<AuthChoiceOption> = [
|
||||
label: "OpenCode Zen (multi-model proxy)",
|
||||
hint: "Claude, GPT, Gemini via opencode.ai/zen",
|
||||
},
|
||||
{ value: "minimax-api", label: "MiniMax M2.5" },
|
||||
{ value: "minimax-api", label: "MiniMax M2.5 (API-Key)" },
|
||||
{
|
||||
value: "minimax-api-key-cn",
|
||||
label: "MiniMax M2.5 (CN)",
|
||||
label: "MiniMax M2.5 (CN API-Key)",
|
||||
hint: "China endpoint (api.minimaxi.com)",
|
||||
},
|
||||
{
|
||||
value: "minimax-api-lightning",
|
||||
label: "MiniMax M2.5 Lightning",
|
||||
label: "MiniMax M2.5 Lightning (API-Key)",
|
||||
hint: "Faster, higher output cost",
|
||||
},
|
||||
{ value: "custom-api-key", label: "Custom Provider" },
|
||||
|
||||
Reference in New Issue
Block a user