From cf29ff304209e64cdb6d6746092b65dc8c9cab9e Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 14:55:14 -0700 Subject: [PATCH] fix: use native http/https modules for agent creation The previous code imported http/https from follow-redirects via a fragile cast `(followRedirects as any).default`. These wrappers may not properly expose the Agent constructor in all bundling environments, causing "Cannot read properties of undefined (reading 'call')" when making requests to Azure OpenAI endpoints. Switches to native Node.js http/https modules for agent creation. The agent creation logic is otherwise unchanged. Fixes #11828 Fixes #8700 --- packages/fetch/src/fetch.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/fetch/src/fetch.ts b/packages/fetch/src/fetch.ts index e965899d4c9..5524486c303 100644 --- a/packages/fetch/src/fetch.ts +++ b/packages/fetch/src/fetch.ts @@ -1,14 +1,13 @@ import { RequestOptions } from "@continuedev/config-types"; -import * as followRedirects from "follow-redirects"; +import * as http from "http"; import { HttpProxyAgent } from "http-proxy-agent"; +import * as https from "https"; import { HttpsProxyAgent } from "https-proxy-agent"; import { BodyInit, RequestInit, Response } from "node-fetch"; import { getAgentOptions } from "./getAgentOptions.js"; import patchedFetch from "./node-fetch-patch.js"; import { getProxy, shouldBypassProxy } from "./util.js"; -const { http, https } = (followRedirects as any).default; - function logRequest( method: string, url: URL,