test(tools): cover tool policy helpers

This commit is contained in:
Peter Steinberger
2026-01-13 06:32:59 +00:00
parent 2ae3b45ac1
commit f50e06a1b6
2 changed files with 49 additions and 0 deletions

View File

@@ -631,6 +631,17 @@ describe("createClawdbotCodingTools", () => {
expect(names.has("browser")).toBe(false);
});
it("expands group shorthands in global tool deny policy", () => {
const tools = createClawdbotCodingTools({
config: { tools: { deny: ["group:fs"] } },
});
const names = new Set(tools.map((tool) => tool.name));
expect(names.has("read")).toBe(false);
expect(names.has("write")).toBe(false);
expect(names.has("edit")).toBe(false);
expect(names.has("exec")).toBe(true);
});
it("lets agent profiles override global profiles", () => {
const tools = createClawdbotCodingTools({
sessionKey: "agent:work:main",