Elffuss BraidHub

kikocis/continue public

use patched fetch in openai adapters - FETCH 15, OPENAI ADAPTERS 44
Changeseta10cd911423228f331cc6ed5a71869cd520871ab0306228b1a755caf7aea6f7e
AuthorDallin Romney <dallinromney@gmail.com> · 2025-06-26 15:07 -07:00
CommitterDallin Romney <dallinromney@gmail.com> · 2025-06-26 15:07 -07:00
Parents6d25b61e8034

Browse the files at this changeset

7 files changed

modified packages/fetch/package-lock.json +2 −2
@@ -1,12 +1,12 @@
11 {
22 "name": "@continuedev/fetch",
3- "version": "1.0.13",
3+ "version": "1.0.15",
44 "lockfileVersion": 3,
55 "requires": true,
66 "packages": {
77 "": {
88 "name": "@continuedev/fetch",
9- "version": "1.0.13",
9+ "version": "1.0.15",
1010 "license": "Apache-2.0",
1111 "dependencies": {
1212 "@continuedev/config-types": "^1.0.5",
modified packages/fetch/package.json +1 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/fetch",
3- "version": "1.0.14",
3+ "version": "1.0.15",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
modified packages/fetch/src/fetch.ts +2 −2
@@ -4,7 +4,7 @@
44 import { HttpsProxyAgent } from "https-proxy-agent";
55 import { BodyInit, RequestInit, Response } from "node-fetch";
66 import { getAgentOptions } from "./getAgentOptions.js";
7-import fetch from "./node-fetch-patch.js";
7+import patchedFetch from "./node-fetch-patch.js";
88 import { getProxy, shouldBypassProxy } from "./util.js";
99
1010 const { http, https } = (followRedirects as any).default;
@@ -144,7 +144,7 @@
144144
145145 // fetch the request with the provided options
146146 try {
147- const resp = await fetch(url, {
147+ const resp = await patchedFetch(url, {
148148 ...init,
149149 body: finalBody,
150150 headers: headers,
modified packages/fetch/src/index.ts +3 −0
@@ -5,10 +5,13 @@
55 toAsyncIterable,
66 } from "./stream.js";
77
8+import patchedFetch from "./node-fetch-patch.js";
9+
810 import { fetchwithRequestOptions } from "./fetch.js";
911
1012 export {
1113 fetchwithRequestOptions,
14+ patchedFetch,
1215 streamJSON,
1316 streamResponse,
1417 streamSse,
modified packages/openai-adapters/package-lock.json +7 −6
@@ -1,17 +1,17 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.43",
3+ "version": "1.0.44",
44 "lockfileVersion": 3,
55 "requires": true,
66 "packages": {
77 "": {
88 "name": "@continuedev/openai-adapters",
9- "version": "1.0.43",
9+ "version": "1.0.44",
1010 "license": "Apache-2.0",
1111 "dependencies": {
1212 "@continuedev/config-types": "^1.0.5",
1313 "@continuedev/config-yaml": "^1.0.51",
14- "@continuedev/fetch": "^1.0.11",
14+ "@continuedev/fetch": "^1.0.15",
1515 "dotenv": "^16.5.0",
1616 "json-schema": "^0.4.0",
1717 "node-fetch": "^3.3.2",
@@ -595,9 +595,10 @@
595595 }
596596 },
597597 "node_modules/@continuedev/fetch": {
598- "version": "1.0.11",
599- "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.11.tgz",
600- "integrity": "sha512-GRYqAdV3DhRxg463zeSzOdVIk/bhjuuxAxzX0fG35Kz6sHUsU2wr7SDY91zO2ataYUkjnbOa3q1xIpnRnOoRHA==",
598+ "version": "1.0.15",
599+ "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.15.tgz",
600+ "integrity": "sha512-49jLwAwAOczcFLfa2Og9+c+qxrq+Z6+p+B5BbXgHENrQIsuST1liKTXEiga5gSVAyHD+m+1Ftl4jqRq2oxMngw==",
601+ "license": "Apache-2.0",
601602 "dependencies": {
602603 "@continuedev/config-types": "^1.0.5",
603604 "follow-redirects": "^1.15.6",
modified packages/openai-adapters/package.json +2 −2
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.43",
3+ "version": "1.0.44",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
1414 "dependencies": {
1515 "@continuedev/config-types": "^1.0.5",
1616 "@continuedev/config-yaml": "^1.0.51",
17- "@continuedev/fetch": "^1.0.11",
17+ "@continuedev/fetch": "^1.0.15",
1818 "dotenv": "^16.5.0",
1919 "json-schema": "^0.4.0",
2020 "node-fetch": "^3.3.2",
modified packages/openai-adapters/src/util.ts +3 −4
@@ -1,6 +1,5 @@
11 import { RequestOptions } from "@continuedev/config-types";
2-import { fetchwithRequestOptions } from "@continuedev/fetch";
3-import fetch from "node-fetch";
2+import { fetchwithRequestOptions, patchedFetch } from "@continuedev/fetch";
43 import { type RequestInfo, type RequestInit } from "openai/_shims/index";
54 import {
65 ChatCompletionChunk,
@@ -141,9 +140,9 @@
141140
142141 export function customFetch(
143142 requestOptions: RequestOptions | undefined,
144-): typeof fetch {
143+): typeof patchedFetch {
145144 if (process.env.FEATURE_FLAG_DISABLE_CUSTOM_FETCH) {
146- return fetch;
145+ return patchedFetch;
147146 }
148147 return (req: URL | RequestInfo, init?: RequestInit) => {
149148 if (typeof req === "string" || req instanceof URL) {