diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 95ead56e..8dd9647c 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Fixed JSON parse failures for compressed fetch responses under Node 26.0 by installing undici fetch globals alongside pi's global dispatcher ([#4650](https://github.com/earendil-works/pi/issues/4650), [#4652](https://github.com/earendil-works/pi/issues/4652), [#4653](https://github.com/earendil-works/pi/issues/4653)). - Fixed npm-family package commands on Windows to avoid shell argument splitting when install prefixes contain spaces ([#4623](https://github.com/earendil-works/pi/issues/4623)). ## [0.75.0] - 2026-05-17 diff --git a/packages/coding-agent/src/cli.ts b/packages/coding-agent/src/cli.ts index 6e0e8403..68f960fe 100644 --- a/packages/coding-agent/src/cli.ts +++ b/packages/coding-agent/src/cli.ts @@ -5,7 +5,7 @@ * * Test with: npx tsx src/cli-new.ts [args...] */ -import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici"; +import { EnvHttpProxyAgent, install as installUndiciGlobals, setGlobalDispatcher } from "undici"; import { APP_NAME } from "./config.js"; import { main } from "./main.js"; @@ -19,4 +19,9 @@ process.emitWarning = (() => {}) as typeof process.emitWarning; // AbortController-based deadlines via retry.provider.timeoutMs. setGlobalDispatcher(new EnvHttpProxyAgent({ 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 +// dispatcher without decompressing them, causing response.json() failures. +installUndiciGlobals(); + main(process.argv.slice(2));