test: quote tool policy warnings

This commit is contained in:
Shakker
2026-05-11 21:27:37 +01:00
parent 07f4b7130f
commit a9fcdf727a
+13 -17
View File
@@ -72,8 +72,9 @@ describe("tool-policy-pipeline", () => {
},
],
});
expect(warnings.length).toBe(1);
expect(warnings[0]).toContain("unknown entries (wat)");
expect(warnings).toEqual([
"tools: tools.allow allowlist contains unknown entries (wat). These entries won't match any tool unless the plugin is enabled.",
]);
});
test("suppresses built-in profile warnings for unavailable gated core tools", () => {
@@ -91,12 +92,9 @@ describe("tool-policy-pipeline", () => {
label: "tools.profile (coding)",
suppressUnavailableCoreToolWarningAllowlist: ["apply_patch"],
});
expect(warnings.length).toBe(1);
expect(warnings[0]).toContain("unknown entries (browser)");
expect(warnings[0]).not.toContain("apply_patch");
expect(warnings[0]).toContain(
"shipped core tools but unavailable in the current runtime/provider/model/config",
);
expect(warnings).toEqual([
"tools: tools.profile (coding) allowlist contains unknown entries (browser). These entries are shipped core tools but unavailable in the current runtime/provider/model/config.",
]);
});
test("still warns for explicit allowlists that mention unavailable gated core tools", () => {
@@ -104,13 +102,9 @@ describe("tool-policy-pipeline", () => {
allow: ["apply_patch"],
label: "tools.allow",
});
expect(warnings.length).toBe(1);
expect(warnings[0]).toContain("unknown entries (apply_patch)");
expect(warnings[0]).toContain(
"shipped core tools but unavailable in the current runtime/provider/model/config",
);
expect(warnings[0]).not.toContain("Allowlist contains only plugin entries");
expect(warnings[0]).not.toContain("unless the plugin is enabled");
expect(warnings).toEqual([
"tools: tools.allow allowlist contains unknown entries (apply_patch). These entries are shipped core tools but unavailable in the current runtime/provider/model/config.",
]);
});
test("default profile steps suppress unavailable baseline profile entries", () => {
@@ -229,8 +223,10 @@ describe("tool-policy-pipeline", () => {
],
});
expect(warnings).toHaveLength(2);
expect(warnings[1]).toContain("unknown_0");
expect(warnings).toEqual([
"tools: tools.allow allowlist contains unknown entries (unknown_256). These entries won't match any tool unless the plugin is enabled.",
"tools: tools.allow allowlist contains unknown entries (unknown_0). These entries won't match any tool unless the plugin is enabled.",
]);
});
test("applies allowlist filtering when core tools are explicitly listed", () => {