fix(http): disable proxy connect timeout - #1571
Conversation
Assistant-model: GPT-5.5
|
PR Review: fix(http): disable proxy connect timeout Thanks for tackling this — the diagnosis (spurious "Connection error." while a slow CONNECT tunnel is still establishing behind a policy proxy) is well-reasoned, and the changelog plus inline comment clearly explain the intent. A couple of things are worth verifying before merge. 🔴 High priority — is The change passes a top-level
If
🟠 The test cannot catch the above — it asserts the mock, not behavior Because undici is fully mocked ( 🟢 Minor / nits
Summary Intent and scope are good and the change is minimal. The blocker is confirming the undici option name: if it is |
Assistant-model: GPT-5.5
Review:
|
Summary
Disables Undici's implicit 10-second connect timeout on Atomic's global proxy-aware HTTP dispatcher (
EnvHttpProxyAgent). Under policy/proxy layers such as Pier, the CONNECT tunnel can legitimately take longer than 10 seconds to establish; without this change, Undici aborts the connection mid-handshake and the failure surfaces as a spurious providerConnection error.instead of going through normal provider/agent retry handling.Changes
packages/coding-agent/src/core/http-dispatcher.ts: extract dispatcher construction options into a new exportedcreateHttpDispatcherOptions(timeoutMs)helper and passconnectTimeout: 0toundici.EnvHttpProxyAgent, disabling the fixed connect-phase timeout while keeping the existing configurablebodyTimeout/headersTimeoutidle timeout behavior.configureHttpDispatchernow delegates to the helper.packages/coding-agent/test/http-dispatcher.test.ts: new regression test assertingcreateHttpDispatcherOptionsreturnsconnectTimeout: 0alongside the configured idle timeouts. The helper is asserted directly rather than mockingundici.EnvHttpProxyAgent, avoiding brittle module-mocking ofundici.packages/coding-agent/CHANGELOG.md: document the fix under[Unreleased] / Fixed.Validation
bun run --cwd packages/coding-agent test -- test/http-dispatcher.test.tsbun run typecheckbun run check:file-lengthbun run lint,bun run check:file-length,bun run test:unit)