fix(coding-agent): align undici fetch globals
closes #4650 closes #4652 closes #4653
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user