fix(http): retry dropped provider connections by default - #1544
Conversation
Long-context + thinking=xhigh turns go quiet for minutes; a sandbox proxy or prod edge then closes the idle stream, undici resets, and the OpenAI SDK throws a fatal "Connection error" because provider retries were pinned to 0. - retry.provider.maxRetries default 0 -> 5 so socket drops (status-undefined) retry instead of aborting; maxRetryDelayMs cap still fails fast on long quota waits - DEFAULT_HTTP_IDLE_TIMEOUT_MS 600000 -> 700000 (~12 min) + new ~12 min preset to tolerate long no-token windows - evals: drop hard-coded httpIdleTimeoutMs:0 from atomic_pier.py and atomic_harbor.py so they inherit the new defaults - evals: mirror pier's fd/ripgrep install in atomic_harbor.py - docs + changelog Assistant-model: Claude Opus 4.8
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Code Review —
|
Reverts the idle timeout bump (700000 -> 600000) and the ~12 min preset; keeps the provider retry default (5) which is the actual fix for dropped streams. Evals still inherit the standard 10-minute default after dropping httpIdleTimeoutMs:0. Assistant-model: Claude Opus 4.8
Review: retry dropped connections and widen idle timeout defaultsThanks for the detailed write-up and root-cause analysis — the reasoning for preferring drop-tolerance via retries over an unbounded idle timeout is sound. The core change ( 🔴 PR description is out of sync with the diffThe description's "Core defaults" section claims a change to
Neither change exists in the diff — This matters beyond bookkeeping: the eval harnesses previously set 🟡 No test coverage for the changed defaultThere are zero tests referencing
🟡 Two retry layers now stack — confirm the interplay
🟡 Verify the
|
Summary
Eval runs against
github-copilotintermittently failed mid-run with{"error":"Connection error"}after a longthinking=xhighturn. Root cause: a multi-minute no-token window (model thinking) lets the eval sandbox proxy / prod Copilot edge close the idle stream → undici socket reset → OpenAI SDK throws a fatalAPIConnectionError, because provider/SDK retries were pinned to0. Disabling the client idle timeout (httpIdleTimeoutMs:0) didn't help — it only lets Atomic wait on a socket the server already severed. The fix is to make socket-drop recovery the default.Changes
retry.provider.maxRetriesdefault0→5so status-undefined connection drops retry instead of aborting. The existingretry.provider.maxRetryDelayMs(60s) cap still fails fast on long quota/rate-limit waits, so this does not block on usage limits.httpIdleTimeoutMs:0fromatomic_pier.pyandatomic_harbor.py; both now inherit the standard 10-minute idle timeout default.atomic_harbor.pyinstall mirrors pier — installsfd-find/ripgrep(+git,curl) and symlinksfdfind→fd.docs/settings.mdandCHANGELOG.md.The idle timeout default is unchanged (10 min /
600000).Notes
typecheck,lint,check:file-length, andtest:unitall pass via prek. Recovery now comes from retrying drops, not from waiting forever on a severed socket; the finite idle timeout still reclaims stale connections.