




















@@ -6,6 +6,7 @@ const mocks = vi.hoisted(() => ({
66shouldSuppressBuiltInModel: vi.fn(() => {
77throw new Error("runtime model suppression should be skipped");
88}),
9+shouldSuppressBuiltInModelFromManifest: vi.fn(() => false),
910loadProviderCatalogModelsForList: vi.fn().mockResolvedValue([
1011{
1112id: "gpt-5.5",
@@ -21,6 +22,7 @@ const mocks = vi.hoisted(() => ({
21222223vi.mock("../../agents/model-suppression.js", () => ({
2324shouldSuppressBuiltInModel: mocks.shouldSuppressBuiltInModel,
25+shouldSuppressBuiltInModelFromManifest: mocks.shouldSuppressBuiltInModelFromManifest,
2426}));
25272628vi.mock("./list.provider-catalog.js", () => ({
@@ -76,6 +78,14 @@ describe("appendProviderCatalogRows", () => {
7678});
77797880expect(mocks.shouldSuppressBuiltInModel).not.toHaveBeenCalled();
81+expect(mocks.shouldSuppressBuiltInModelFromManifest).toHaveBeenCalledWith({
82+provider: "codex",
83+id: "gpt-5.5",
84+config: {
85+agents: { defaults: { model: { primary: "codex/gpt-5.5" } } },
86+models: { providers: {} },
87+},
88+});
7989expect(rows).toMatchObject([
8090{
8191key: "codex/gpt-5.5",
@@ -84,4 +94,47 @@ describe("appendProviderCatalogRows", () => {
8494},
8595]);
8696});
97+98+it("applies manifest suppression when runtime model-suppression hooks are skipped", async () => {
99+mocks.loadProviderCatalogModelsForList.mockResolvedValueOnce([
100+{
101+id: "gpt-5.3-codex-spark",
102+name: "GPT-5.3 Codex Spark",
103+provider: "openai",
104+api: "openai-responses",
105+baseUrl: "https://api.openai.com/v1",
106+input: ["text", "image"],
107+},
108+]);
109+mocks.shouldSuppressBuiltInModelFromManifest.mockReturnValueOnce(true);
110+const rows: ModelRow[] = [];
111+112+await appendProviderCatalogRows({
113+ rows,
114+seenKeys: new Set(),
115+context: {
116+cfg: {
117+agents: { defaults: { model: { primary: "openai/gpt-5.5" } } },
118+models: { providers: {} },
119+},
120+agentDir: "/tmp/openclaw-agent",
121+authStore: { version: 1, profiles: {}, order: {} },
122+configuredByKey: new Map(),
123+discoveredKeys: new Set(),
124+filter: { provider: "openai", local: false },
125+skipRuntimeModelSuppression: true,
126+},
127+});
128+129+expect(mocks.shouldSuppressBuiltInModel).not.toHaveBeenCalled();
130+expect(mocks.shouldSuppressBuiltInModelFromManifest).toHaveBeenCalledWith({
131+provider: "openai",
132+id: "gpt-5.3-codex-spark",
133+config: {
134+agents: { defaults: { model: { primary: "openai/gpt-5.5" } } },
135+models: { providers: {} },
136+},
137+});
138+expect(rows).toEqual([]);
139+});
87140});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。