From 967fb4d8b99cdb7cdd05fc597e88f16f67f64483 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 18 May 2026 11:57:51 +0200 Subject: [PATCH] fix(coding-agent): disable undici http2 Fixes #4681. Fixes #4682. --- packages/coding-agent/CHANGELOG.md | 4 ++++ packages/coding-agent/src/cli.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index b60da8e4..4ab8d314 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fixed undici 8 HTTP/2 destroyed-session races crashing the Node CLI by preserving the previous HTTP/1.1-only fetch dispatcher behavior ([#4681](https://github.com/earendil-works/pi/issues/4681)). + ## [0.75.2] - 2026-05-18 ### Fixed diff --git a/packages/coding-agent/src/cli.ts b/packages/coding-agent/src/cli.ts index f75d6bd1..1fdadb99 100644 --- a/packages/coding-agent/src/cli.ts +++ b/packages/coding-agent/src/cli.ts @@ -17,7 +17,7 @@ process.emitWarning = (() => {}) as typeof process.emitWarning; // (e.g. vLLM buffering a large tool call) exceed that and abort the SSE stream // with UND_ERR_BODY_TIMEOUT. Disable both — provider SDKs enforce their own // AbortController-based deadlines via retry.provider.timeoutMs. -undici.setGlobalDispatcher(new undici.EnvHttpProxyAgent({ bodyTimeout: 0, headersTimeout: 0 })); +undici.setGlobalDispatcher(new undici.EnvHttpProxyAgent({ allowH2: false, bodyTimeout: 0, headersTimeout: 0 })); // Keep fetch and the dispatcher on the same undici implementation. Node 26.0's // bundled fetch can otherwise consume compressed responses through npm undici's