@@ -4,7 +4,6 @@ import os from "node:os";
|
4 | 4 | import path from "node:path"; |
5 | 5 | import { describe, expect, it, test, vi } from "vitest"; |
6 | 6 | import type { OpenClawConfig } from "../config/config.js"; |
7 | | -import { applyAgentDefaultPrimaryModel } from "../plugins/provider-model-primary.js"; |
8 | 7 | import type { RuntimeEnv } from "../runtime.js"; |
9 | 8 | import { withEnvAsync } from "../test-utils/env.js"; |
10 | 9 | import { |
@@ -70,38 +69,6 @@ describe("buildCleanupPlan", () => {
|
70 | 69 | }); |
71 | 70 | }); |
72 | 71 | |
73 | | -describe("applyAgentDefaultPrimaryModel", () => { |
74 | | -it("does not mutate when already set", () => { |
75 | | -const cfg = { agents: { defaults: { model: { primary: "a/b" } } } } as OpenClawConfig; |
76 | | -const result = applyAgentDefaultPrimaryModel({ cfg, model: "a/b" }); |
77 | | -expect(result.changed).toBe(false); |
78 | | -expect(result.next).toBe(cfg); |
79 | | -}); |
80 | | - |
81 | | -it("normalizes legacy models", () => { |
82 | | -const cfg = { agents: { defaults: { model: { primary: "legacy" } } } } as OpenClawConfig; |
83 | | -const result = applyAgentDefaultPrimaryModel({ |
84 | | - cfg, |
85 | | -model: "a/b", |
86 | | -legacyModels: new Set(["legacy"]), |
87 | | -}); |
88 | | -expect(result.changed).toBe(false); |
89 | | -expect(result.next).toBe(cfg); |
90 | | -}); |
91 | | - |
92 | | -it("normalizes retired Google Gemini primary models before writing config", () => { |
93 | | -const cfg = { agents: { defaults: {} } } as OpenClawConfig; |
94 | | -const result = applyAgentDefaultPrimaryModel({ |
95 | | - cfg, |
96 | | -model: "google/gemini-3-pro-preview", |
97 | | -}); |
98 | | -expect(result.changed).toBe(true); |
99 | | -expect(result.next.agents?.defaults?.model).toEqual({ |
100 | | -primary: "google/gemini-3.1-pro-preview", |
101 | | -}); |
102 | | -}); |
103 | | -}); |
104 | | - |
105 | 72 | describe("cleanup path removals", () => { |
106 | 73 | function createRuntimeMock() { |
107 | 74 | return { |
|