Provider maintenance subprocesses don't inherit macOS system proxy settings #2709
I launch T3 Code from the macOS Dock. My network requires an HTTP proxy configured at the macOS system level. Notably, the Codex CLI itself seems to detect the system proxy and works fine for its runtime operations, but T3 Code's own provider update mechanism does not.
When T3 Code triggers a provider update, providerMaintenanceRunner.ts:79 spawns brew upgrade / npm install -g / opencode upgrade without any proxy context, and the command eventually times out.
DesktopShellEnvironment.ts already captures PATH, SSH_AUTH_SOCK, etc. from the login shell environment but does not retrieve macOS system proxy settings (e.g. via scutil --proxy or SystemConfiguration framework).
Not sure what the right approach is — maybe a resolveSystemProxyEnv utility in packages/shared that macOS could surface system proxy config, and then wire it through the maintenance runner. Just flagging the gap.
tanstack-source added labelsbug
Same gap on macOS, with the proxy set as env vars in
~/.zshrc(HTTPS_PROXY/HTTP_PROXY/NO_PROXYpointing at a local PAC-resolving proxy) rather than as a fixed proxy in System Settings.T3 Code already reads a list of variables from the login shell (
LOGIN_SHELL_ENV_NAMES:PATH,SSH_AUTH_SOCK,NODE_EXTRA_CA_CERTS, …), but the proxy variables aren't on it. When T3 Code is launched from the Dock, the providers and agents it starts (OpenCode, Claude, Codex, pi) get no proxy and can't reach anything outside the corporate network.#36301 doesn't cover this setup: it only applies to provider update commands, and it skips PAC, which is what the system proxy here is.
Adding
HTTPS_PROXY,HTTP_PROXY,NO_PROXY(and the lowercase forms) toLOGIN_SHELL_ENV_NAMESwould fix it without any system-proxy detection. Right now I start T3 Code through a small launcher that exports them and runsopen -a 'T3 Code (Beta)'. Thelaunchctl setenvworkaround above also works, but it changes the proxy for every app.Same gap on macOS, and it is not limited to provider maintenance — the Issues panel and PR sync for a self-hosted GitLab are affected the same way.
Setup
- T3 Code (Beta) 0.1.11, launched from the Dock.
- The GitLab host resolves to an internal address that is only reachable through an HTTP proxy; direct TCP 443 times out.
- The proxy is exported from a zsh profile (
HTTP_PROXY/HTTPS_PROXY), not configured in System Settings.
Symptom Every GitLab project in the Issues panel showed
GitLab CLI command failed.; GitHub projects loaded fine.Diagnosis
server.trace.ndjsonshowed 10 projects × 9 consecutiveGitLabIssueTracker.listIssuesfailures, ~5064 ms each, all ending inVcsProcessExitError: VcsProcess failed in GitLabCli.execute: glab (<cwd>) exited with 1.- Running the same
glab api projects/<urlencoded>/issues?...by hand succeeds with the proxy environment; underenv -iit fails in ~5.1 s withdial tcp <internal>:443: i/o timeout. The 5.1 s matches the trace's 5064 ms, so the child process is connecting directly. - Electron's own traffic is unaffected because it uses the macOS system proxy. Only spawned CLIs (
glab,gh,gitover https) are affected, consistent withLOGIN_SHELL_ENV_NAMEScontaining onlyPATH,__MISE_DIFF,JAVA_HOME.
Workaround that worked Persist the environment instead of calling
launchctl setenvby hand: a LaunchAgent withRunAtLoadthat sets the proxy variables in the GUI session.<key>ProgramArguments</key> <array> <string>/bin/sh</string><string>-c</string> <string>/bin/launchctl setenv HTTPS_PROXY http://127.0.0.1:6152; /bin/launchctl setenv HTTP_PROXY http://127.0.0.1:6152; /bin/launchctl setenv NO_PROXY 'localhost,127.0.0.1,192.168.0.0/16,10.0.0.0/8'</string> </array> <key>RunAtLoad</key><true/>After
launchctl bootstrap gui/$(id -u) <plist>and restarting T3, the new server process carriesHTTPS_PROXY/HTTP_PROXY, and all 10listIssuescalls succeed.Suggestion Reading the proxy variables from the login shell (or resolving the macOS system proxy via
scutil --proxy) would fix this class for everyone who sets the proxy in a shell profile. The LaunchAgent route works, but it leaks the setting to every GUI app on the machine, as the comment above already notes.
Sign in to join this conversation.
t3 code respects https_proxy env, so to set it for apps launched from dock you want