Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): forward Bitbucket auth to WSL #7620

Closed0rdep(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7620/headopened View on GitHub

The Windows desktop process did not forward Bitbucket credentials into its managed WSL backend. As a result, Bitbucket requests ran anonymously even when the credentials were configured in the Windows environment, eventually exhausting the anonymous API rate limit.

This adds all three supported Bitbucket credential variables to the existing WSL forwarding allowlist and extends the focused backend configuration test to verify both the child environment and generated WSLENV. Secret values remain in the child environment; WSLENV contains only their names.

Fixes #7621.

Related: #5840 documents the same missing-credential symptom on macOS. This PR is limited to the Windows/WSL launch path and does not claim to fix the macOS shell-profile path.

Validation:

  • vp test run apps/desktop/src/backend/DesktopBackendConfiguration.test.ts (23 tests)
  • vp fmt --check apps/desktop/src/backend/DesktopBackendConfiguration.ts apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
  • vp run --filter @t3tools/desktop typecheck

Implemented with GPT-5.6 SOL (OpenAI Codex) via pi.


Note

Low Risk Small, targeted change to the existing WSL secret-forwarding list with matching unit test coverage; no new auth logic beyond env propagation.

Overview Windows desktop → WSL backend now forwards the three supported Bitbucket credential env vars (T3CODE_BITBUCKET_ACCESS_TOKEN, T3CODE_BITBUCKET_EMAIL, T3CODE_BITBUCKET_API_TOKEN) using the same path as existing LLM keys: values on the WSL child env, and names appended to WSLENV when not already declared.

The resolveWsl WSLENV test was extended to assert those values and the updated WSLENV string while still preserving pre-existing entries and avoiding duplicate forwarding for vars already listed (e.g. OPENAI_API_KEY).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1aa2bfe8de8754bccef1c9700700ffa80da3ceb6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Forward T3CODE_BITBUCKET_* env vars to WSL in DesktopBackendConfiguration

Extends WSL_FORWARDED_ENV_NAMES to also forward T3CODE_BITBUCKET_ACCESS_TOKEN, T3CODE_BITBUCKET_EMAIL, and T3CODE_BITBUCKET_API_TOKEN into the WSL backend environment via resolveWsl, and appends their names to WSLENV when present. Updates the corresponding test to assert these vars reach config.env and that existing WSLENV entries are preserved.

Macroscope summarized 1aa2bfe.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 749b24be-b1b8-4702-a035-3e01f93ccac7

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Approved at 1aa2bfe

      Macroscope's review found this PR approvable — This change adds Bitbucket authentication environment variables to an existing list of credentials forwarded to WSL, following the established pattern for OpenAI and Anthropic keys. The modification is mechanical with appropriate test coverage.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Superseded: #7621 was closed as fixed by #14103 (Bitbucket credentials can be saved from Settings → Source Control, so WSLENV forwarding is no longer required for that path). Closing this PR as leftover hygiene.

    5. juliusmarminge closed this

Sign in to join this conversation.