Repository navigation
fix(desktop): GitHub and every other request follow the system proxy (#133) - #135
Merged
Merged
Conversation
…133) The main process called Node's global fetch (undici), which connects directly: it never reads the system proxy or a PAC script. On a network that reaches the internet only through a proxy, Sign in with GitHub failed at its first request, and so did the GitHub API, the macOS update check, cloud AI providers and crash reports, while the renderer worked. netFetch (apps/desktop/src/main/netFetch.ts) is a fetch-compatible wrapper over Electron's net.fetch, so these requests resolve the proxy the way Chromium does. It omits session cookies and the HTTP cache (Node's fetch had neither), answers redirect: "manual" with the 3xx over net.request (net.fetch rejects it), keeps loopback (Ollama, LM Studio) on Node's fetch, and falls back to Node's fetch before app ready and outside Electron. AiBridge hands it to makeProvider, which already took a fetch. A failed request now says why and which address instead of only "Check your network connection", e.g. "Couldn't reach GitHub (ERR_PROXY_CONNECTION_FAILED) — github.com/login/device/code", keeps the error as `cause`, and logs it. The AI providers name the code the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….0.0.1" The Ubuntu runner's curl now says "Failed to connect to <host> port 443 via 127.0.0.1" where it said "127.0.0.1 port 1". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Fixes #133.
netFetch(Electronnet.fetch), injected where shared packages take a fetch. Loopback (Ollama / LM Studio) still uses Node's fetch.redirect: "manual"vianet.request(Actions logs), streaming and aborts verified.Tests: netFetch (fake
net, fail-before on the old GitHub code), plain-Node fallback + a source guard against global fetch in src/main, networkReason. Desktop 2029/2029, ai 157/157, verify OK. Real app with--proxy-server: new build CONNECTs github.com:443 through the proxy and fails clearly on a dead proxy; the 2.7.0 code went direct either way.🤖 Generated with Claude Code