fix(desktop): keep macOS local services off system proxies and find user Node installs#26
Merged
Merged
Conversation
…ser Node installs - Merge loopback hosts into NO_PROXY in the local profile: httpx honours http_proxy/all_proxy, and a desktop system proxy (e.g. Clash) answers 127.0.0.1 targets with 502 Bad Gateway, which broke sidecar readiness at startup and every internal loopback call including site publishing. - Broaden the macOS bootstrap installer's optional-Node probe to per-user install locations (~/.local/bin, Homebrew on both architectures, and nvm/fnm/mise/volta version trees): the GUI launch PATH misses them, so Node was reported missing and React site building silently degraded. - Raise the script-runner /get_file fetch cap to 64MB so site publishes up to the 40MB pack limit no longer fail with 413 after a successful in-sandbox tar. - Cover the NO_PROXY merge and the installer probe list with tests.
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 macOS, the desktop client's bundled local server could break in two independent ways:
127.0.0.1services (backend ↔ MCP sidecars ↔ script runner ↔ internal publish callbacks) speaking httpx, which honourshttp_proxy/https_proxy/all_proxy. With a desktop system proxy enabled (e.g. Clash), those loopback requests were routed through the proxy, which answers127.0.0.1targets with 502 Bad Gateway — startup readiness failed (http://127.0.0.1:9113/mcp→ 502) and site publishing errored at runtime./opt/homebrew/binand/usr/local/binas fallbacks. Node installed under~/.local/binor via nvm/fnm/mise/volta was reported missing, silently degrading React site building, Playwright screenshots, and document tools.Additionally, the script-runner
/get_filecap (10MB) was below the site-publish pack limit (40MB), so publishing a larger site (e.g. with images) failed with 413 after a successful in-sandbox tar.Changes
127.0.0.1,localhost,::1) intoNO_PROXY/no_proxyat startup. Proxy variables themselves are left intact — external model/API calls may legitimately need them.~/.local/bin, Homebrew on both architectures,~/.volta/bin, and nvm/fnm/mise version trees./get_filenow uses a dedicated 64MB fetch cap so publishes up to the 40MB pack limit succeed.NO_PROXYmerge semantics and the installer probe list.Testing
tests/test_local_profile.pypasses, including the new proxy-bypass test.cargo test --libpasses indesktop/src-tauri(installer content assertions).~/.local/bin, and a site publish round-trips successfully (workspace at~/.hugagent/workspace, hosted page served back correctly).