Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix Codex Desktop detection on Windows #4346

ClosedAndrew-Forster(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/4346/headopened View on GitHub

On Windows, T3 Code currently assumes codex is available on PATH. That works for standalone npm installs, but Codex Desktop and Microsoft Store installs keep their CLI under %LOCALAPPDATA%\OpenAI\Codex\bin\<runtime>\codex.exe, so the provider reports "not installed" even though Codex is present. This adds a Windows-only fallback that first respects explicit binary paths and normal PATH resolution, then selects the newest valid Desktop runtime; the resolved path is captured once so probes, sessions, and text generation all use the same executable. Non-Windows behavior is unchanged, and standalone CLI installs still win. I added focused coverage for PATH priority, explicit overrides, missing runtimes, platform isolation, and runtime selection, plus a prerequisite note. Validation: 7 focused tests, a read-only smoke test against a real Microsoft Store installation (codex-cli 0.145.0-alpha.18), server and full-workspace typechecks, and vp check (0 errors; 14 unrelated existing warnings).

Note

Fix Codex Desktop CLI detection on Windows by resolving executable path from LOCALAPPDATA

  • On Windows, resolveCodexExecutablePath first checks if codex/codex.exe resolves via PATH; if not, it searches %LOCALAPPDATA%/OpenAI/Codex/bin for the newest versioned codex.exe unpacked by Codex Desktop.
  • The CodexDriver factory now calls resolveCodexExecutablePath at creation time and stores the resolved path in effectiveConfig, which is also passed to maintenance capability checks.
  • findCodexDesktopBinary selects the newest binary by modified time across versioned subdirectories, with path as a tiebreaker.
  • Non-Windows platforms and non-default binary paths are returned unchanged.
  • Behavioral Change: on Windows with no codex on PATH, the provider may silently switch to the Codex Desktop-extracted binary instead of failing.
Macroscope summarized 6a5bfc2.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. 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: 5b7fe545-e076-4ac2-870d-6302fd5a2384

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.
    3. Windows check on this box, tests run from the PR files against current workspace deps.

      CodexExecutable.test.ts: 7/7. The module does not exist on main, so there is no revert-fail of an old implementation — the tests pin a new helper.

      Live here:

      • %LOCALAPPDATA%\Programs\OpenAI\Codex\bin does not exist
      • codex on PATH is AppData\Roaming\npm\codex.ps1 (npm global)

      So I cannot smoke the Store/Desktop fallback. I can confirm the PATH-wins case is the one this machine needs, and the tests do pin that (prefers a normal PATH installation, darwin short-circuit).

      CONFLICTING against current main. #6356 adds Programs\OpenAI\Codex\bin to knownWindowsCliDirs — a different path than this PR's %LOCALAPPDATA%\OpenAI\Codex\bin\<runtime>\codex.exe. They compose; they are not substitutes.

      Title is Fix Codex… — this repo's merged PRs use fix(scope):.

    4. Closing as part of the open-PR backlog sweep (wave 1).

      Reason: Abandoned draft for Codex Desktop on Windows; conflicted since Jul.

      Reopen if this is still wanted and you’re willing to rebase onto current main.

    5. juliusmarminge closed this

Sign in to join this conversation.