fix(coding-agent): align undici fetch globals

closes #4650

closes #4652

closes #4653
This commit is contained in:
Mario Zechner
2026-05-18 01:56:14 +02:00
parent 9e2bfc7c40
commit 085230373f
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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));