[Bug]: GitHub PR sync fails behind TLS-inspecting proxy since nightly 20261006.2752 #31067
main fromrefs/pull/31067/head·opened View on GitHubProblem#
Fixes #16703. A Windows desktop backend started in WSL loses explicit CA configuration exported in the distro's shell profile. GitHub PR sync then fails TLS verification behind an inspecting proxy, even though the configured CA works in the shell.
WSL preflight discovers PATH in a shell, but the backend starts through wsl.exe --exec env. Exports from that earlier shell cannot reach the new process.
Change#
Read NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and SSL_CERT_DIR from the distro's configured interactive login shell before starting the backend. Pass their Linux values as individual environment arguments for both packaged and mounted runtimes, keeping bootstrap input available on stdin.
The probe captures only those three variables, ignores startup output, bounds each value to 4,096 characters, and falls back to an empty patch if the five-second probe fails. OS trust defaults and Windows-origin certificate-path forwarding are unchanged.
Scope and approval#
This fixes the explicit WSL-profile configuration loss confirmed in the maintainer triage. It does not implement the separate proposal to trust OS roots by default or add settings. The four changed files are the WSL service, backend launch configuration, and their existing tests.
Verification#
- Added a regression to the existing quote-sensitive WSL launch test. On the original code it fails because all three expected CA arguments are absent:
1 failed | 16 skipped. - From
apps/desktop, with a process-onlyELECTRON_OVERRIDE_DIST_PATH=$env:TEMPto prevent an import-time Electron download:vp test run src/wsl/DesktopWslEnvironment.test.ts src/backend/DesktopBackendConfiguration.test.tspasses all 37 tests. Coverage includes packaged and mounted launch paths, interactive profile exports, startup noise, spaces, apostrophes, equals signs, embedded newlines, and invalid environment records. vp run check:changed --concurrency 1passed formatting, lint, both knip checks, affected-package typechecks, and the 37 tests. The root Vitest run reported a Vite-server shutdown warning after the tests passed; the check command exited successfully.- Real Debian / Node 26.12.1 fixture using the generated discovery script, production parser, actual
resolveWslconfiguration, andwsl.exe --exec envstartup:
Both CAs and shell configuration were temporary; no host trust store or real profile was changed. Runtime staging/preflight services were stubbed, and the executable branch used a fixture launcher rather than the packaged T3 binary. The HTTPS fixture was stopped afterward. This proves transport trust throughNode script baseline: selected CA rejected; unrelated CA rejected; CA env=0/3 Node script fixed: selected CA HTTP 200; unrelated CA rejected; CA env=3/3 Executable baseline: selected CA rejected; unrelated CA rejected; CA env=0/3 Executable fixed: selected CA HTTP 200; unrelated CA rejected; CA env=3/3 Bootstrap stdin: exact in all four runs. Profile stdin: 0 bytes.NODE_EXTRA_CA_CERTS; the individual trust effects ofSSL_CERT_FILEandSSL_CERT_DIRwere not tested.
Not checked: real zsh/fish startup and a full desktop session against a corporate proxy. The executed shell fixture uses Bash with isolated temporary configuration.
Created with GPT-6.1 Sol through the Codex harness in T3 Code. Subagents using the same model and harness researched issue and PR scope, implemented the regression and fix, reviewed the diff, and prepared runtime verification.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
b2e1dc8Macroscope's review found this PR approvable — WSL backend startup now honors certificate paths already configured in the user's login environment, supporting TLS-inspecting proxies. Collection is bounded and falls back without overrides on failure; TLS verification remains enabled.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Important
Review skipped#
Review was skipped as selected files did not have any reviewable changes.
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: f5ae808
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
211fd84e-f7c5-4ac9-a9b2-7993cc4f0b29
Commits-
Reviewing files that changed from the base of the PR and between bc94ae2b44638ee041eccad5046ecf2e4c505a50 and 3cae3aa9be72e52410b30d6c2c72896ee4f84ab6.
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The WSL environment service reads supported certificate variables from the selected distro’s login shell. The backend launch configuration adds the returned variables to the WSL environment arguments.
Changes: WSL certificate environment forwarding
Layer / File(s) Summary Capture and parse certificate variables
apps/desktop/src/wsl/DesktopWslEnvironment.ts,apps/desktop/src/wsl/DesktopWslEnvironment.test.tsThe service captures NODE_EXTRA_CA_CERTS,SSL_CERT_FILE, andSSL_CERT_DIRfrom a WSL login shell. It parses complete, nonempty records up to 4096 characters, uses a five-second timeout, and returns an empty record on command failure. Tests cover shell output and parser limits.Add certificate variables to WSL launch arguments
apps/desktop/src/backend/DesktopBackendConfiguration.ts,apps/desktop/src/backend/DesktopBackendConfiguration.test.tsThe WSL start-config resolver reads certificate variables for the selected distro and adds them after PATHin the launch arguments. Tests check distro selection and values with spaces, quotes, and equals signs.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · previous review99f9e-
This change forwards explicit CA settings from the WSL distro's login shell into the desktop-launched backend, and it falls back to the current behavior if the lookup fails. No concrete merge-blocking risk was found. The only gap is that a full desktop session behind a TLS-inspecting proxy was not tested.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the main change: GitHub PR sync failing behind a TLS-inspecting proxy after a nightly build. The changeset forwards NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and SSL_CERT_DIR from the WSL lo… Description check The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. It links issue #16703and the maintainer triage, explains the root cause …Linked Issues check Issue #16703requires the desktop-launched WSL backend to receive CA configuration exported in the distro shell profile. The reviewed head implements this. In apps/desktop/src/wsl/DesktopWslEnvironmen…Out of Scope Changes check The whole-PR diff against the merge base changes four files: DesktopWslEnvironment.ts, DesktopBackendConfiguration.ts, and their two test files. The source changes add only the certificate-environment… Full details: Title check
-
Explanation
The title names the main change: GitHub PR sync failing behind a TLS-inspecting proxy after a nightly build. The changeset forwards NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and SSL_CERT_DIR from the WSL login shell into the backend launch, which targets that failure. The title states the symptom, not the fix, and includes a '[Bug]:' prefix and a build identifier. These are noise, but the title still reflects the primary change.
Full details: Description check
-
Explanation
The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. It links issue
#16703and the maintainer triage, explains the root cause (exports from the preflight shell do not reach the wsl.exe --exec env launch), describes the fix and its limits, and reports tests, a fixture run, and what was not checked. The header comment in the template asks for a conventional commit title, and the PR title does not follow that format. The description also includes a model/harness attribution line, which the template requests. The description is complete, so it passes.
Full details: Linked Issues check
-
Explanation
Issue
#16703requires the desktop-launched WSL backend to receive CA configuration exported in the distro shell profile. The reviewed head implements this. In apps/desktop/src/wsl/DesktopWslEnvironment.ts, readCertificateEnvironment runs the distro's configured login shell with -ilc, captures NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and SSL_CERT_DIR as NUL-delimited records, and parses only complete records. Values are limited to 4096 characters, and the probe has a five-second timeout. On failure it returns an empty record. In apps/desktop/src/backend/DesktopBackendConfiguration.ts, resolveWslStartConfig adds each returned pair as a separate NAME=value argument to the wsl.exe --exec env command, before the runtime command. This applies to the shared launch path used for both packaged and mounted runtimes. The change covers the explicit profile-configuration objective, which the issue lists as a possible fix. Tests for the launch paths and parser were reported as passing, but I did not run them. The PR description states that the fixture showed the selected CA accepted after the fix. The end-to-end GitHub PR sync behind a proxy was not verified, so the result rests on the fixture and the code path.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff against the merge base changes four files: DesktopWslEnvironment.ts, DesktopBackendConfiguration.ts, and their two test files. The source changes add only the certificate-environment read, its parser and script builder, the test stub, and the env-argument forwarding in resolveWslStartConfig. Each change supports the
#16703objective. The PR does not add OS-root trust defaults, a settings surface, or new certificate-path forwarding from Windows origins, as its description states. I found no unrelated change in the diff.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 0517d15
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3cef9b4c-9d8a-4d1a-85a8-9820a83a9627
Commits-
Reviewing files that changed from the base of the PR and between a55363d6e75234a2d53ca21b51d0fba43884de2b and 99f9e9babf24c5d460c5bf5365017b38ee182338.
Files selected for processing: 2-
apps/desktop/src/backend/DesktopBackendConfiguration.test.tsapps/desktop/src/backend/DesktopBackendConfiguration.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
The automated pipeline stopped on this pull request and will not merge it:
the proof has no capture anyone can open:
- The base certificate-verification failure was not observed because Windows and WSL are unavailable.
- Forwarding shell-profile CA configuration into the desktop-launched WSL backend was not verified at runtime.
- GitHub merge synchronization and automatic thread settlement behind a TLS-inspecting proxy were not exercised.
- No public capture URLs exist; no upload was attempted because no valid reproduction capture was produced.
It stays open for a person to finish or close.
Harry1620(GitHub profile, opens in a new tab) linked this to fix #16703
tanstack-source added labelsbug
juliusmarminge added labelstakeover:in-progress
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
- Permanent blocker: A Windows desktop session capable of running and capturing the Electron app is needed to configure its WSL backend and perform the prescribed full restart. The supplied Windows pool explicitly has no desktop session. CA forwarding, GitHub merge synchronization, and automatic thread settlement remain unverified on both revisions.
It stays open for a person to finish or close.
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
juliusmarminge added labelstakeover:in-progress
juliusmarminge removed labelstakeover:blocked
The automated pipeline stopped on this pull request and will not merge it:
the capture step could not show the problem on the base commit, so there is nothing to prove fixed.
Configured NODE_EXTRA_CA_CERTS in the WSL interactive and login shell profiles. Confirmed shell Node could reach GitHub through the inspecting proxy, while directly launched Node without that variable failed certificate verification. Fully closed and launched each desktop build from Windows with Ubuntu selected as its WSL backend. Provisioned GitHub credentials privately, created a synthetic project and thread through application RPC, linked an already merged public PR, and seeded the same stale open snapshot. Opened the linked PR panel and allowed synchronization to run. Base retained Open, showed a GitHub connection failure, and logged an unable-to-verify-the-first-certificate error; its backend lacked NODE_EXTRA_CA_CERTS. Head showed Merged in both the sidebar and loaded PR details; its backend received NODE_EXTRA_CA_CERTS. Final stills were captured after two screenshots 500 ms apart were identical. Inspected both stills and sampled both recordings before upload. No external merge was performed and automatic settlement was not demonstrated. Stopped the processes, removed fixture state and worktrees, and released the Windows lease.
It stays open for a person to finish or close.
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
juliusmarminge added labelstakeover:in-progress
juliusmarminge removed labelstakeover:blocked
Evidence#
Windows desktop + Ubuntu WSL2, light theme, 1400×950, fresh backend state per commit. The inspection proxy forwarded to real GitHub; only the Linux interactive login profile supplied NODE_EXTRA_CA_CERTS. Seed the same synthetic thread with an Open snapshot of already merged PR #36429, refresh that reference, then open PR details.
Before After f5ae8088c3 3cae3aa9be 



Before recording After recording Base's sanitized runtime excerpt contains the nested TLS error 'unable to verify the first certificate'. Both final stills passed the 500 ms identical-screenshot check. Capture driver; drivers, seed module, raw frames, timing and transcripts.
Scope: synchronization and PR loading are proved. A live GitHub merge and automatic settlement were not demonstrated.
Not shown:
- A live GitHub Open-to-Merged transition was not performed: an already merged public PR was used with a locally seeded Open snapshot, without forge writes.
- Automatic settlement of an otherwise eligible thread was not demonstrated: the fixture PR merged before the synthetic thread was created, so the settlement age condition was not satisfied.
- SSL_CERT_FILE and SSL_CERT_DIR forwarding were not exercised; the proof covers NODE_EXTRA_CA_CERTS.
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
This PR conflicts with
main. Rebase it or mergemaininto it. If it still conflicts after 7 days with no activity, it will be closed automatically.See the conflict window.
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Closing: this PR still conflicts with
mainand has had no activity for 7 days since the rebase request.To continue, rebase the branch and open a new PR that links this one. See the conflict window.
github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes