Skip to content

Commit ff386a8

Browse files
chezsmithyContinue
andcommitted
fix(cli): fix tool name access in ToolPermissionService.agentfile.test.ts
- Replace t.name with t.function?.name for tool name access - Add .filter(Boolean) to remove any undefined names from the array - Ensures consistent tool name access pattern across all test files - All 18 agent file integration tests now pass - Maintains consistency with other permission service fixes Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <[email protected]>
1 parent 8b19c76 commit ff386a8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

extensions/cli/src/services/ToolPermissionService.agentfile.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ describe("ToolPermissionService - Agent File Integration", () => {
295295
});
296296

297297
// Should exclude all other built-in tools
298-
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map((t) => t.name);
298+
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map(
299+
(t) => t.function?.name,
300+
).filter(Boolean);
299301
const notListed = allBuiltInNames.filter(
300302
(name) => name !== "Bash" && name !== "Read",
301303
);
@@ -376,7 +378,9 @@ describe("ToolPermissionService - Agent File Integration", () => {
376378
);
377379

378380
// Should exclude all built-in tools
379-
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map((t) => t.name);
381+
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map(
382+
(t) => t.function?.name,
383+
).filter(Boolean);
380384
for (const toolName of allBuiltInNames) {
381385
expect(policies).toContainEqual({
382386
tool: toolName,
@@ -454,7 +458,9 @@ describe("ToolPermissionService - Agent File Integration", () => {
454458
});
455459

456460
// Should exclude other built-in tools
457-
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map((t) => t.name);
461+
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map(
462+
(t) => t.function?.name,
463+
).filter(Boolean);
458464
const notListed = allBuiltInNames.filter(
459465
(name) => name !== "Bash" && name !== "Read",
460466
);
@@ -517,7 +523,9 @@ describe("ToolPermissionService - Agent File Integration", () => {
517523
});
518524

519525
// Should exclude other built-in tools
520-
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map((t) => t.name);
526+
const allBuiltInNames = ALL_BUILT_IN_TOOLS.map(
527+
(t) => t.function?.name,
528+
).filter(Boolean);
521529
const notBash = allBuiltInNames.filter((name) => name !== "Bash");
522530

523531
for (const toolName of notBash) {

0 commit comments

Comments
 (0)