

























@@ -87,6 +87,13 @@ vi.mock("../agents/model-selection.js", () => {
8787});
8888const modelKey = (provider: string, model: string) =>
8989`${provider.trim().toLowerCase()}/${model.trim().toLowerCase()}`;
90+const isModelKeyAllowedBySet = (allowedKeys: ReadonlySet<string>, key: string) => {
91+if (allowedKeys.has(key)) {
92+return true;
93+}
94+const slash = key.indexOf("/");
95+return slash > 0 && allowedKeys.has(`${key.slice(0, slash)}/*`);
96+};
9097const resolvePrimary = (cfg?: ConfigWithModels): string | undefined => {
9198const primary = cfg?.agents?.defaults?.model;
9299if (typeof primary === "string") {
@@ -132,6 +139,7 @@ vi.mock("../agents/model-selection.js", () => {
132139};
133140}),
134141buildConfiguredModelCatalog: vi.fn(() => []),
142+ isModelKeyAllowedBySet,
135143isCliProvider: vi.fn(() => false),
136144 modelKey,
137145 normalizeModelRef,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。