Skip to content

Commit 17ab9b9

Browse files
authored
fix(agents): skip wildcard catalog metadata refs (#86524)
* fix(agents): skip wildcard catalog metadata refs * fix(models): skip wildcard configured rows
1 parent 947febb commit 17ab9b9

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/agents/model-selection-shared.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ function buildModelCatalogMetadata(
553553
const aliasByKey = new Map<string, string>();
554554
const configuredModels = params.cfg.agents?.defaults?.models ?? {};
555555
for (const [rawKey, entryRaw] of Object.entries(configuredModels)) {
556+
if (rawKey.trim().endsWith("/*")) {
557+
continue;
558+
}
556559
const alias = ((entryRaw as { alias?: string } | undefined)?.alias ?? "").trim();
557560
if (!alias) {
558561
continue;

src/commands/models/list.configured.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,23 @@ describe("resolveConfiguredEntries", () => {
7373
expect(entries[0]?.aliases).toEqual(["Kilo Gemini"]);
7474
expect(entries[0]?.tags).toEqual(new Set(["default", "configured"]));
7575
});
76+
77+
it("treats provider wildcard defaults as selectors, not configured model rows", () => {
78+
const { entries } = resolveConfiguredEntries({
79+
agents: {
80+
defaults: {
81+
model: "openai/gpt-5.5",
82+
models: {
83+
"openai-codex/*": {},
84+
"openai/gpt-5.5": { alias: "Primary" },
85+
},
86+
},
87+
},
88+
models: { providers: {} },
89+
});
90+
91+
expect(entries.map((entry) => entry.key)).toEqual(["openai/gpt-5.5"]);
92+
expect(entries[0]?.aliases).toEqual(["Primary"]);
93+
expect(entries[0]?.tags).toEqual(new Set(["default", "configured"]));
94+
});
7695
});

src/commands/models/list.configured.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export function resolveConfiguredEntries(cfg: OpenClawConfig) {
7373
});
7474

7575
for (const key of Object.keys(cfg.agents?.defaults?.models ?? {})) {
76+
if (key.trim().endsWith("/*")) {
77+
continue;
78+
}
7679
const resolved = resolveModelRefFromString({
7780
cfg,
7881
raw: key,

0 commit comments

Comments
 (0)