fix: disable Happy Eyeballs for the zcode launch so slow-edge networks connect - #182
Open
camerontaylor wants to merge 1 commit into
Open
fix: disable Happy Eyeballs for the zcode launch so slow-edge networks connect#182camerontaylor wants to merge 1 commit into
camerontaylor wants to merge 1 commit into
Conversation
…s connect Node's autoSelectFamily (default since 20.13) gives each connect attempt a 250ms budget. On networks with no IPv6 route where the provider edge answers in just over 250ms, every undici connect is aborted before establishing and fetch fails with an empty-message AggregateError — model requests then fail as 'Cannot connect to API:' on every retry, while curl and plain connects to the same host succeed. Pass --no-network-family-autoselection to restore the pre-20.13 sequential connect; ZCODE_KEEP_HAPPY_EYEBALLS=1 opts out. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On networks without an IPv6 route where the model provider edge answers in just over 250ms, every model request from the spawned zcode app-server fails with:
(empty message — the cause is an
AggregateErrorwhose message is empty; the per-address codes live in.errors[]). Each request burns the full retry budget (~1.5s per attempt, 11 attempts) and the turn fails, whilecurland plainnet.connectto the same host succeed.Root cause
Node enables
autoSelectFamily(RFC 8305 Happy Eyeballs) by default since 20.13, with a 250ms per-attempt budget. zcode's model client goes through undicifetch, so:EHOSTUNREACH, no route)ETIMEDOUTAggregateError→ "Cannot connect to API:"Reproduced on macOS with mise node 22.20 and 24.21 against
api.z.ai:Fix
Pass
--no-network-family-autoselectionin the explicit-node launch path, restoring the pre-20.13 sequential connect (which succeeds — the route is fine, only the attempt budget is too tight).ZCODE_KEEP_HAPPY_EYEBALLS=1opts out for networks that genuinely need RFC 8305 racing.Note: this only covers the JS-bundle launch path where we build the argv. Wrapper-script bins (non-
.jszcode) keep their own behavior — hosts in that situation can setNODE_OPTIONS=--no-network-family-autoselectionfor the daemon.Verified end-to-end via the Paseo provider plugin: patched build completes
model.request.completed → turn.completedwhere the unpatched build failed every request for 30 minutes.🤖 Generated with Claude Code