From b73bd7cdedea6a3463892171e89c41b4a1ffad0c Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sun, 28 Sep 2025 18:45:22 +0000 Subject: [PATCH] fix: resolve TypeScript type error for agent property in fetch - Use spread operator with type assertion for Node.js-specific agent property - Ensures compatibility with standard RequestInit type while allowing HTTPS agent --- src/services/mcp/McpHub.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/mcp/McpHub.ts b/src/services/mcp/McpHub.ts index df1eb1fb7d..2694315393 100644 --- a/src/services/mcp/McpHub.ts +++ b/src/services/mcp/McpHub.ts @@ -859,10 +859,11 @@ export class McpHub { // Custom fetch function that includes the HTTPS agent reconnectingEventSourceOptions.fetch = (url: string | URL, init: RequestInit) => { const headers = new Headers({ ...(init?.headers || {}), ...(configInjected.headers || {}) }) + // Use type assertion for Node.js-specific agent property return fetch(url, { ...init, headers, - agent: agent as any, + ...({ agent } as any), }) } }