From c0c0e9b7a0a768515181e6ae7defe9f06199ea18 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Wed, 13 Aug 2025 12:27:09 -0700 Subject: feat(core): Migrate read_many_files, shell, and web_fetch. (#6167) --- packages/core/src/tools/web-fetch.test.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'packages/core/src/tools/web-fetch.test.ts') diff --git a/packages/core/src/tools/web-fetch.test.ts b/packages/core/src/tools/web-fetch.test.ts index 6be9d504..b589c139 100644 --- a/packages/core/src/tools/web-fetch.test.ts +++ b/packages/core/src/tools/web-fetch.test.ts @@ -20,7 +20,10 @@ describe('WebFetchTool', () => { it('should return confirmation details with the correct prompt and urls', async () => { const tool = new WebFetchTool(mockConfig); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toEqual({ type: 'info', @@ -37,7 +40,10 @@ describe('WebFetchTool', () => { prompt: 'fetch https://github.com/google/gemini-react/blob/main/README.md', }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toEqual({ type: 'info', @@ -57,7 +63,10 @@ describe('WebFetchTool', () => { getApprovalMode: () => ApprovalMode.AUTO_EDIT, } as unknown as Config); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toBe(false); }); @@ -69,7 +78,10 @@ describe('WebFetchTool', () => { setApprovalMode, } as unknown as Config); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); if ( confirmationDetails && -- cgit v1.2.3