Repository navigation
fix(connectors): fall back to another address for OAuth - #1148
Merged
Merged
Conversation
nixuuu
enabled auto-merge (squash)
November 23, 2026 09:19
nixuuu
disabled auto-merge
November 23, 2026 09:24
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.
When DNS returns an unreachable IPv6 address before a reachable IPv4 address, the OAuth transport now tries the next address from the same validated DNS answer. It prefers the address that answered for subsequent requests to that origin. The HTTP request starts only after TCP connects, so a failed response or TLS handshake cannot trigger a replay. Origin, redirect, certificate and SNI checks still apply.
The fallback is sequential and follows resolver order. Each TCP dial has up to 2 seconds within the existing 20-second request budget. Full Happy Eyeballs would reduce latency with overlapping dials and needs additional scheduling and socket cleanup. The reported failure returns immediately and is covered by the sequential fallback.
Start errors distinguish network, metadata and client registration failures. A network error during token refresh also reaches the worker when it blocks a tool call. Gateway logs and exports use allowlisted codes and HTTP status fields.
Verification
nix-hetzner-1(Linux, Bun 1.4.5),check:tmppassed 39 tests on PR revision907a31b6across OAuth egress and startup, connector calls and refresh, Slack user refresh, redirects and connector errors. The regression includes the four reported pre-connect errors and Darwin'sEADDRNOTAVAIL, no extra DNS lookup, an ambiguous POST failure, and a real IPv6 refusal followed by one IPv4 POST over HTTPS. The TLS fixture rejects a mismatched certificate hostname.git diff --checkpassed. A local TLS probe confirmed SNI and hostname verification. Notion's public discovery endpoint returned HTTP 200 with the pinned transport.Thanks @kubaul for reporting the issue and identifying the address ordering.
Fixes: #1050