























@@ -72,8 +72,9 @@ describe("tool-policy-pipeline", () => {
7272},
7373],
7474});
75-expect(warnings.length).toBe(1);
76-expect(warnings[0]).toContain("unknown entries (wat)");
75+expect(warnings).toEqual([
76+"tools: tools.allow allowlist contains unknown entries (wat). These entries won't match any tool unless the plugin is enabled.",
77+]);
7778});
78797980test("suppresses built-in profile warnings for unavailable gated core tools", () => {
@@ -91,26 +92,19 @@ describe("tool-policy-pipeline", () => {
9192label: "tools.profile (coding)",
9293suppressUnavailableCoreToolWarningAllowlist: ["apply_patch"],
9394});
94-expect(warnings.length).toBe(1);
95-expect(warnings[0]).toContain("unknown entries (browser)");
96-expect(warnings[0]).not.toContain("apply_patch");
97-expect(warnings[0]).toContain(
98-"shipped core tools but unavailable in the current runtime/provider/model/config",
99-);
95+expect(warnings).toEqual([
96+"tools: tools.profile (coding) allowlist contains unknown entries (browser). These entries are shipped core tools but unavailable in the current runtime/provider/model/config.",
97+]);
10098});
10199102100test("still warns for explicit allowlists that mention unavailable gated core tools", () => {
103101const warnings = runAllowlistWarningStep({
104102allow: ["apply_patch"],
105103label: "tools.allow",
106104});
107-expect(warnings.length).toBe(1);
108-expect(warnings[0]).toContain("unknown entries (apply_patch)");
109-expect(warnings[0]).toContain(
110-"shipped core tools but unavailable in the current runtime/provider/model/config",
111-);
112-expect(warnings[0]).not.toContain("Allowlist contains only plugin entries");
113-expect(warnings[0]).not.toContain("unless the plugin is enabled");
105+expect(warnings).toEqual([
106+"tools: tools.allow allowlist contains unknown entries (apply_patch). These entries are shipped core tools but unavailable in the current runtime/provider/model/config.",
107+]);
114108});
115109116110test("default profile steps suppress unavailable baseline profile entries", () => {
@@ -229,8 +223,10 @@ describe("tool-policy-pipeline", () => {
229223],
230224});
231225232-expect(warnings).toHaveLength(2);
233-expect(warnings[1]).toContain("unknown_0");
226+expect(warnings).toEqual([
227+"tools: tools.allow allowlist contains unknown entries (unknown_256). These entries won't match any tool unless the plugin is enabled.",
228+"tools: tools.allow allowlist contains unknown entries (unknown_0). These entries won't match any tool unless the plugin is enabled.",
229+]);
234230});
235231236232test("applies allowlist filtering when core tools are explicitly listed", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。