Skip to content

fix(desktop): GitHub and every other request follow the system proxy (#133) - #135

Merged
antonarnaudov merged 2 commits into
mainfrom
fix/desktop-system-proxy
Oct 25, 2026
Merged

antonarnaudov merged 2 commits into
mainfrom
fix/desktop-system-proxy

Conversation

@antonarnaudov

Copy link
Copy Markdown
Contributor

Fixes #133.

  • The desktop main process sent every outbound request (device-flow sign-in, the GitHub API and Actions logs, the macOS update check, AI providers, crash reports) through Node's fetch, which ignores the system proxy/PAC. They now go through one netFetch (Electron net.fetch), injected where shared packages take a fetch. Loopback (Ollama / LM Studio) still uses Node's fetch.
  • net.fetch caveats handled: cookies omitted, HTTP cache off, redirect: "manual" via net.request (Actions logs), streaming and aborts verified.
  • Failures say why and where: "Couldn't reach GitHub (ERR_PROXY_CONNECTION_FAILED) — github.com/login/device/code. Check your network or proxy settings." (query strings dropped; cause kept and logged). AI providers likewise.

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

antonarnaudov and others added 2 commits October 25, 2026 13:00
…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>
@antonarnaudov
antonarnaudov merged commit 3ac676d into main Oct 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub sign-in ignores the system proxy

1 participant