From 36c65658ffaacfc8cf0cb7f8112c6fff022c8683 Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Fri, 15 Aug 2025 17:16:05 +0800 Subject: [PATCH] chore: npm run lint --- packages/core/src/tools/web-fetch.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/core/src/tools/web-fetch.ts b/packages/core/src/tools/web-fetch.ts index 739745a5..01070537 100644 --- a/packages/core/src/tools/web-fetch.ts +++ b/packages/core/src/tools/web-fetch.ts @@ -171,28 +171,11 @@ ${textContent} return false; } - // Perform GitHub URL conversion here to differentiate between user-provided - // URL and the actual URL to be fetched. - let url = params.url; - try { - const parsedUrl = new URL(url); - if ( - parsedUrl.hostname === 'github.com' && - parsedUrl.pathname.includes('/blob/') - ) { - url = url - .replace('github.com', 'raw.githubusercontent.com') - .replace('/blob/', '/'); - } - } catch (e) { - // If the URL is invalid, leave it unchanged (or handle as needed) - } - const confirmationDetails: ToolCallConfirmationDetails = { type: 'info', title: `Confirm Web Fetch`, prompt: `Fetch content from ${params.url} and process with: ${params.prompt}`, - urls: [url], + urls: [params.url], onConfirm: async (outcome: ToolConfirmationOutcome) => { if (outcome === ToolConfirmationOutcome.ProceedAlways) { this.config.setApprovalMode(ApprovalMode.AUTO_EDIT);