Skip to content

Commit 9e5d038

Browse files
committed
fix: preserve legacy runtime model allowlists
1 parent b9c3331 commit 9e5d038

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai
2323

2424
### Fixes
2525

26+
- Agents/models: keep legacy CLI runtime model refs such as `claude-cli/*` in the configured allowlist after canonical runtime migration, so cron `payload.model` overrides keep working. Fixes #75753. Thanks @RyanSandoval.
2627
- CLI/directory: report unsupported directory operations for installed channel plugins instead of prompting to reinstall the plugin when it lacks a directory adapter. Fixes #75770. Thanks @lawong888.
2728
- Web search: keep public provider requests on the strict SSRF guard and reserve private-network access for explicit self-hosted SearXNG/Firecrawl endpoints. Fixes #74357 and supersedes #74360. Thanks @fede-kamel.
2829
- Web search/Firecrawl: allow self-hosted private/internal Firecrawl `baseUrl` endpoints, including HTTP for private targets, while keeping hosted Firecrawl on the strict official endpoint. Fixes #63877 and supersedes #59666, #63941, and #74013. Thanks @jhthompson12, @jzakirov, @Mlightsnow, and @shad0wca7.

src/agents/model-selection.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,34 @@ describe("model-selection", () => {
858858
});
859859
});
860860

861+
it("keeps legacy CLI runtime refs accepted when canonical runtime refs are also configured", () => {
862+
const cfg = {
863+
agents: {
864+
defaults: {
865+
agentRuntime: { id: "claude-cli" },
866+
model: { primary: "anthropic/claude-sonnet-4-6" },
867+
models: {
868+
"anthropic/claude-sonnet-4-6": {},
869+
"claude-cli/claude-sonnet-4-6": {},
870+
},
871+
},
872+
},
873+
} as OpenClawConfig;
874+
875+
const result = resolveAllowedModelRef({
876+
cfg,
877+
catalog: BUNDLED_ALLOWLIST_CATALOG,
878+
raw: "claude-cli/claude-sonnet-4-6",
879+
defaultProvider: "anthropic",
880+
defaultModel: "claude-sonnet-4-6",
881+
});
882+
883+
expect(result).toEqual({
884+
key: "claude-cli/claude-sonnet-4-6",
885+
ref: { provider: "claude-cli", model: "claude-sonnet-4-6" },
886+
});
887+
});
888+
861889
it("strips trailing auth profile suffix before allowlist matching", () => {
862890
const cfg: OpenClawConfig = {
863891
agents: {

src/commands/doctor-legacy-config.migrations.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ describe("normalizeCompatibilityConfigValues", () => {
497497
fallback: "pi",
498498
});
499499
expect(res.config.agents?.defaults?.models).toEqual({
500+
"codex/gpt-5.5": { alias: "legacy-codex" },
500501
"openai/gpt-5.5": { alias: "gpt", params: { temperature: 0.2 } },
502+
"codex/gpt-5.4-mini": {},
501503
"openai/gpt-5.4-mini": {},
502504
});
503505
expect(res.config.agents?.list?.[0]).toMatchObject({
@@ -557,6 +559,7 @@ describe("normalizeCompatibilityConfigValues", () => {
557559
});
558560
expect(res.config.agents?.defaults?.agentRuntime).toEqual({ id: "claude-cli" });
559561
expect(res.config.agents?.defaults?.models).toEqual({
562+
"claude-cli/claude-opus-4-7": { alias: "Opus" },
560563
"anthropic/claude-opus-4-7": { alias: "Anthropic Opus" },
561564
});
562565
});
@@ -583,6 +586,7 @@ describe("normalizeCompatibilityConfigValues", () => {
583586
});
584587
expect(res.config.agents?.defaults?.agentRuntime).toEqual({ id: "codex-cli" });
585588
expect(res.config.agents?.defaults?.models).toEqual({
589+
"codex-cli/gpt-5.5": { alias: "Codex CLI" },
586590
"openai/gpt-5.5": { alias: "OpenAI GPT" },
587591
});
588592
});
@@ -611,6 +615,7 @@ describe("normalizeCompatibilityConfigValues", () => {
611615
id: "google-gemini-cli",
612616
});
613617
expect(res.config.agents?.defaults?.models).toEqual({
618+
"google-gemini-cli/gemini-3.1-pro-preview": { alias: "Gemini CLI" },
614619
"google/gemini-3.1-pro-preview": { alias: "Gemini API" },
615620
});
616621
});

src/commands/doctor/shared/legacy-config-core-normalizers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ function normalizeLegacyRuntimeAllowlistModels(
262262
const migrated = migrateLegacyRuntimeModelRef(rawKey);
263263
if (migrated?.runtime === selectedRuntime) {
264264
changed = true;
265+
next[rawKey] = mergeModelEntry(entry, next[rawKey]);
265266
legacyEntries.push([migrated.ref, entry]);
266267
continue;
267268
}

0 commit comments

Comments
 (0)