





























@@ -109,13 +109,12 @@ describe("collectImplicitFallbackClobberWarnings", () => {
109109list: [{ id: "ops", model: "openai/gpt-5.3" }],
110110});
111111const warnings = collectImplicitFallbackClobberWarnings(cfg);
112-expect(warnings).toHaveLength(1);
113-expect(warnings[0]).toContain("agents.list[0].model (id=ops)");
114-expect(warnings[0]).toContain('"openai/gpt-5.3"');
115-expect(warnings[0]).toContain("bare string with no fallbacks");
116-expect(warnings[0]).toContain("clobbers agents.defaults.model.fallbacks");
117-expect(warnings[0]).toContain("openai/gpt-5.4");
118-expect(warnings[0]).toContain("openai/gpt-5.3");
112+expect(warnings).toStrictEqual([
113+[
114+'- agents.list[0].model (id=ops) is "openai/gpt-5.3", a bare string with no fallbacks. At runtime this clobbers agents.defaults.model.fallbacks (openai/gpt-5.4, openai/gpt-5.3), leaving the agent with no fallbacks.',
115+' Fix: add "fallbacks": [...] to inherit or override, or "fallbacks": [] to explicitly disable.',
116+].join("\n"),
117+]);
119118});
120119121120it("matches runtime fallback resolution for warned string and partial-object shapes", () => {
@@ -146,11 +145,12 @@ describe("collectImplicitFallbackClobberWarnings", () => {
146145list: [{ id: "researcher", model: { primary: "openai/gpt-5.4" } }],
147146});
148147const warnings = collectImplicitFallbackClobberWarnings(cfg);
149-expect(warnings).toHaveLength(1);
150-expect(warnings[0]).toContain("agents.list[0].model (id=researcher)");
151-expect(warnings[0]).toContain('{ primary: "openai/gpt-5.4" }');
152-expect(warnings[0]).toContain('object with no explicit "fallbacks" key');
153-expect(warnings[0]).toContain("clobbers agents.defaults.model.fallbacks");
148+expect(warnings).toStrictEqual([
149+[
150+'- agents.list[0].model (id=researcher) is { primary: "openai/gpt-5.4" }, a object with no explicit "fallbacks" key. At runtime this clobbers agents.defaults.model.fallbacks (openai/gpt-5.4), leaving the agent with no fallbacks.',
151+' Fix: add "fallbacks": [...] to inherit or override, or "fallbacks": [] to explicitly disable.',
152+].join("\n"),
153+]);
154154});
155155156156it("does not warn for object form with blank primary", () => {
@@ -213,8 +213,15 @@ describe("collectImplicitFallbackClobberWarnings", () => {
213213],
214214});
215215const warnings = collectImplicitFallbackClobberWarnings(cfg);
216-expect(warnings).toHaveLength(2);
217-expect(warnings[0]).toContain("agents.list[0].model (id=ops)");
218-expect(warnings[1]).toContain("agents.list[1].model (id=researcher)");
216+expect(warnings).toStrictEqual([
217+[
218+'- agents.list[0].model (id=ops) is "openai/gpt-5.3", a bare string with no fallbacks. At runtime this clobbers agents.defaults.model.fallbacks (openai/gpt-5.4), leaving the agent with no fallbacks.',
219+' Fix: add "fallbacks": [...] to inherit or override, or "fallbacks": [] to explicitly disable.',
220+].join("\n"),
221+[
222+'- agents.list[1].model (id=researcher) is { primary: "openai/gpt-5.4" }, a object with no explicit "fallbacks" key. At runtime this clobbers agents.defaults.model.fallbacks (openai/gpt-5.4), leaving the agent with no fallbacks.',
223+' Fix: add "fallbacks": [...] to inherit or override, or "fallbacks": [] to explicitly disable.',
224+].join("\n"),
225+]);
219226});
220227});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。