Skip to content
Source
Sign inSign up
pingdotgg/t3code

Provider maintenance subprocesses don't inherit macOS system proxy settings #2709

Openmole828(GitHub profile, opens in a new tab) opened this issue 3 comments

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.

  1. t3 code respects https_proxy env, so to set it for apps launched from dock you want

    
    note that this will affect some other apps(i.e discord) too
  2. tanstack-source added labelsbug

  3. Same gap on macOS, with the proxy set as env vars in ~/.zshrc (HTTPS_PROXY / HTTP_PROXY / NO_PROXY pointing 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) to LOGIN_SHELL_ENV_NAMES would fix it without any system-proxy detection. Right now I start T3 Code through a small launcher that exports them and runs open -a 'T3 Code (Beta)'. The launchctl setenv workaround above also works, but it changes the proxy for every app.

  4. 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.ndjson showed 10 projects × 9 consecutive GitLabIssueTracker.listIssues failures, ~5064 ms each, all ending in VcsProcessExitError: 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; under env -i it fails in ~5.1 s with dial 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, git over https) are affected, consistent with LOGIN_SHELL_ENV_NAMES containing only PATH, __MISE_DIFF, JAVA_HOME.

    Workaround that worked Persist the environment instead of calling launchctl setenv by hand: a LaunchAgent with RunAtLoad that 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 carries HTTPS_PROXY / HTTP_PROXY, and all 10 listIssues calls 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.