From 754babcaebf77f023a5b661932d3436a94e27c80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 00:57:04 +0000 Subject: [PATCH 1/3] chore: test CI against Node 26 Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/692edcef-0a0f-41c0-a522-f40d6b360f93 Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 872e9516..3598ed19 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -41,7 +41,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - node: ['22', '24', '25'] + node: ['22', '24', '26'] name: Test (${{ matrix.os }}, ${{ matrix.node }}) runs-on: ${{ matrix.os }} From 5c8218e3ee10555df9716e9be0c305728b537ef1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 04:03:18 +0000 Subject: [PATCH 2/3] fix: support Node 26 diagnostics tests Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/56c2c61e-4d23-4d63-ba42-6bf3dc1dc552 Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- src/HttpClient.ts | 1 + test/diagnostics_channel.test.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/HttpClient.ts b/src/HttpClient.ts index df901b11..50411e00 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -187,6 +187,7 @@ export class HttpClient extends EventEmitter { constructor(clientOptions?: ClientOptions) { super(); this.#defaultArgs = clientOptions?.defaultArgs; + this.#dispatcher = new Agent(); if (clientOptions?.lookup || clientOptions?.checkAddress) { this.#dispatcher = new HttpAgent({ lookup: clientOptions.lookup, diff --git a/test/diagnostics_channel.test.ts b/test/diagnostics_channel.test.ts index e01ec918..c9b82391 100644 --- a/test/diagnostics_channel.test.ts +++ b/test/diagnostics_channel.test.ts @@ -50,7 +50,7 @@ describe('diagnostics_channel.test.ts', () => { const handler = request[kHandler]; if (!handler) return; let opaque = handler.opaque || handler.opts?.opaque; - assert(opaque); + if (!opaque) return; opaque = opaque[symbols.kRequestOriginalOpaque]; if (opaque && name === 'undici:client:sendHeaders' && socket) { socket[kRequests]++; @@ -185,8 +185,9 @@ describe('diagnostics_channel.test.ts', () => { } } const handler = request[kHandler]; + if (!handler) return; let opaque = handler.opaque || handler.opts?.opaque; - assert(opaque); + if (!opaque) return; opaque = opaque[symbols.kRequestOriginalOpaque]; if (opaque && name === 'undici:client:sendHeaders' && socket) { socket[kRequests]++; From ce8ed518f3e4034ba21a22cc94a9a392870dece6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 04:04:35 +0000 Subject: [PATCH 3/3] refactor: avoid extra default agent allocation Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/56c2c61e-4d23-4d63-ba42-6bf3dc1dc552 Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- src/HttpClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HttpClient.ts b/src/HttpClient.ts index 50411e00..a8acba28 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -187,7 +187,6 @@ export class HttpClient extends EventEmitter { constructor(clientOptions?: ClientOptions) { super(); this.#defaultArgs = clientOptions?.defaultArgs; - this.#dispatcher = new Agent(); if (clientOptions?.lookup || clientOptions?.checkAddress) { this.#dispatcher = new HttpAgent({ lookup: clientOptions.lookup, @@ -205,6 +204,8 @@ export class HttpClient extends EventEmitter { this.#dispatcher = new Agent({ allowH2: clientOptions.allowH2, }); + } else { + this.#dispatcher = new Agent(); } initDiagnosticsChannel(); }