Skip to content

Commit f498589

Browse files
committed
test(agent): add removeTools parity-reflection keeper
1 parent acd27b8 commit f498589

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎src/agent/tool-aliases.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,24 @@ describe("withAuthzParityDefinitions", () => {
373373
"read",
374374
]);
375375
});
376+
377+
test("removeTools through the wrapper is reflected in definitions", () => {
378+
let live: ToolDefinition[] = [posixDef("run_shell"), posixDef("read_file")];
379+
const bundle = {
380+
definitions: live,
381+
currentDefinitions: () => live,
382+
removeTools: (names: string[]) => {
383+
live = live.filter((d) => !names.includes(d.name));
384+
},
385+
run: async () => ({ callId: "1", content: "", isError: false }),
386+
};
387+
const wrapped = withAuthzParityDefinitions(bundle);
388+
expect(wrapped.removeTools).toBe(bundle.removeTools);
389+
wrapped.removeTools(["read_file"]);
390+
expect(wrapped.definitions.map((d) => d.name)).toEqual([
391+
"run_shell",
392+
"bash",
393+
"shell",
394+
]);
395+
});
376396
});

0 commit comments

Comments
 (0)