Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): import CA trust variables from the login shell #19604

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/19604/headmerged by maria-rcks View on GitHub

maria-rckscommented

Problem

The desktop app imports a fixed set of variables from the login shell, and CA trust variables are not in it. When the node on the shell's PATH has no bundled root store (for example a shared-OpenSSL Node such as zerobrew's node 26), every Node child the server spawns fails TLS unless SSL_CERT_FILE/SSL_CERT_DIR reach it.

Seen on macOS: clicking Update for Pi fails with "Update command exited with code 1." The server runs pi update --self, which exits with:

Error: Could not determine latest pi version: fetch failed (UNABLE_TO_GET_ISSUER_CERT_LOCALLY)

The same command succeeds from a terminal, where the shell profile exports SSL_CERT_FILE.

Change

Import SSL_CERT_FILE, SSL_CERT_DIR, and NODE_EXTRA_CA_CERTS from the login shell, filling them only when the app process has none, like XDG_* and HOMEBREW_*.

Scope and approval

Small focused fix of an obvious bug: CA trust configured in the shell profile is dropped for GUI launches, so provider updaters and agents on such setups cannot make HTTPS requests. No behavior change when these variables are unset.

Verification

  • Reproduced in T3 Code Nightly 0.0.46-nightly.20261014.3118: the Pi update toast showed "Update command exited with code 1".
  • Re-ran pi update --self with the server process's exact environment: exit 1 with the error above. Same environment plus the SSL_CERT_FILE/SSL_CERT_DIR values the login shell probe returns: Updated pi from 1.0.0 to 1.2.0, exit 0.
  • /opt/zerobrew/bin/node -e 'fetch("https://registry.npmjs.org/")' fails with UNABLE_TO_GET_ISSUER_CERT_LOCALLY in a clean env and returns 200 with SSL_CERT_FILE set.
  • Added a case to DesktopShellEnvironment.test.ts (missing vars are hydrated, an existing SSL_CERT_DIR is kept). vp test run src/shell/DesktopShellEnvironment.test.ts passes 19/19; desktop typecheck, lint, and fmt check pass.
  • Unverified: a packaged desktop build running the update end to end.

Written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

    1. Warning

      Review limit reached

      Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

      Next included review available in 30 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used all 10 included reviews currently available.

      Learn how review limits work.

      Review configuration:

      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: c7d97a5e-2da1-4151-a189-c5e2175a2654
      📥 Commits

      Reviewing files that changed from the base of the PR and between 348f217a853dd4a23d7fa4834dedb05f545c2075 and e96a53ee9bcc0ea0a111495a66f6dbff87d88bbe.

      📒 Files selected for processing: 2
      • apps/desktop/src/shell/DesktopShellEnvironment.test.ts
      • apps/desktop/src/shell/DesktopShellEnvironment.ts
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. juliusmarminge added labelsmacroscope-review

    4. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This is a narrowly scoped, well-tested fix that propagates shell-configured CA trust into the desktop backend and agents while preserving existing values. Because it changes TLS certificate trust behavior for production processes, human review is warranted.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB−7 B (−0.1%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB−7 B (−0.6%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 348f217 · PR result: e96a53e · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    6. maria-rcks merged thisaa81d12

    7. maria-rcks closed this

Sign in to join this conversation.