Skip to content

Commit 354cabc

Browse files
MirecXclaude
andcommitted
Fix undici 5-minute timeout: set headersTimeout and bodyTimeout to 30min
Node.js built-in fetch uses undici with hardcoded 300s (5min) timeouts for headersTimeout and bodyTimeout. SDK-level timeout options don't override these. See: nodejs/node#46375 Fix: configure EnvHttpProxyAgent with 30-minute timeouts in the global dispatcher, so slow local models (e.g., 397B at 10 tps) don't get killed during long thinking phases. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 7effd22 commit 354cabc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/coding-agent/src

‎packages/coding-agent/src/cli.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ process.emitWarning = (() => {}) as typeof process.emitWarning;
1111
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
1212
import { main } from "./main.js";
1313

14-
setGlobalDispatcher(new EnvHttpProxyAgent());
14+
setGlobalDispatcher(
15+
new EnvHttpProxyAgent({
16+
headersTimeout: 30 * 60 * 1000, // 30 min - slow local models need time for thinking
17+
bodyTimeout: 30 * 60 * 1000,
18+
}),
19+
);
1520

1621
main(process.argv.slice(2));

0 commit comments

Comments
 (0)