





















@@ -1,4 +1,5 @@
11import { beforeEach, describe, expect, it, vi } from "vitest";
2+import type { OpenClawConfig } from "../config/types.js";
23import type { NormalizedModelCatalogRow } from "../model-catalog/index.js";
34import type { RuntimeEnv } from "../runtime.js";
45import type { WizardPrompter } from "../wizard/prompts.js";
@@ -85,6 +86,18 @@ function createKilocodeProvider() {
8586};
8687}
878889+function createTestModel(id: string, name = id) {
90+return {
91+ id,
92+ name,
93+reasoning: false,
94+input: ["text"] as Array<"text" | "image" | "video" | "audio">,
95+cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
96+contextWindow: 128_000,
97+maxTokens: 4096,
98+};
99+}
100+88101function createApplyAuthChoiceConfig(includeMinimaxProvider = false) {
89102return {
90103config: {
@@ -101,7 +114,7 @@ function createApplyAuthChoiceConfig(includeMinimaxProvider = false) {
101114minimax: {
102115baseUrl: "https://api.minimax.io/anthropic",
103116api: "anthropic-messages",
104-models: [{ id: "MiniMax-M2.7", name: "MiniMax M2.7" }],
117+models: [createTestModel("MiniMax-M2.7", "MiniMax M2.7")],
105118},
106119}
107120 : {}),
@@ -303,11 +316,11 @@ describe("promptAuthConfig", () => {
303316ollama: {
304317baseUrl: "https://ollama.com",
305318api: "ollama",
306-models: [{ id: "deepseek-v4-pro", name: "deepseek-v4-pro" }],
319+models: [createTestModel("deepseek-v4-pro")],
307320},
308321},
309322},
310-};
323+} satisfies OpenClawConfig;
311324mocks.applyAuthChoice.mockResolvedValue({ config: existingConfig });
312325mocks.promptModelAllowlist.mockResolvedValue({ models: undefined });
313326mocks.resolveProviderPluginChoice.mockReturnValue(null);
@@ -332,11 +345,11 @@ describe("promptAuthConfig", () => {
332345ollama: {
333346baseUrl: "https://ollama.com",
334347api: "ollama",
335-models: [{ id: "deepseek-v4-pro", name: "deepseek-v4-pro" }],
348+models: [createTestModel("deepseek-v4-pro")],
336349},
337350},
338351},
339-};
352+} satisfies OpenClawConfig;
340353mocks.applyAuthChoice.mockResolvedValue({
341354config: {
342355 ...existingConfig,
@@ -348,7 +361,12 @@ describe("promptAuthConfig", () => {
348361ref: "github-copilot/claude-opus-4.7",
349362provider: "github-copilot",
350363id: "claude-opus-4.7",
364+mergeKey: "github-copilot/claude-opus-4.7",
351365name: "Claude Opus 4.7",
366+source: "manifest",
367+input: ["text"],
368+reasoning: false,
369+status: "available",
352370},
353371]);
354372mocks.promptModelAllowlist.mockResolvedValue({ models: undefined });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。