Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix Linux desktop Codex CLI detection at startup #1100

MergedRyan-D-Gast(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/1100/headmerged by juliusmarminge View on GitHub

Hello, when running the .AppImage on Linux and creating the corresponding .desktop application, t3code was unable to find the codex CLI even though it was correctly available in my PATH (set in both .bashrc and .zshrc).

At first I assumed this was something specific to my system, but after digging into it I determined the issue was caused by how PATH hydration was handled in the t3code startup sequence. This PR fixes that

Fixes #234 Fixes #367 Fixes #269 Fixes #301 Also related to #226

What Changed

  • Fixed desktop PATH hydration so Linux packaged launches resolve codex the same way terminal launches do.
  • Moved server PATH hydration earlier in startup so provider health checks run after PATH has been normalized.
  • Added regression tests covering startup ordering and shared shell PATH behavior.

Why

When launching from a Linux desktop entry, the app could report that the Codex CLI was missing or not executable even though codex worked fine in the terminal. This happened for two reasons:

  1. PATH hydration for desktop/server startup only handled macOS, so Linux GUI launches could miss shell-managed paths.
  2. Provider health was computed before PATH normalization ran, which could cause the Codex status to be reported incorrectly during startup.

Note

Fix Codex CLI detection on Linux by extending shell environment hydration to Linux

  • Extends fixPath in os-jank.ts and syncShellEnvironment in syncShellEnvironment.ts to run on both darwin and linux (previously macOS-only).
  • Adds resolveLoginShell in shell.ts to determine the login shell per platform: uses the provided $SHELL, falls back to /bin/zsh on macOS and /bin/bash on Linux, and returns undefined on unsupported platforms.
  • Both fixPath and syncShellEnvironment now return early without modifying the environment if no login shell can be resolved (e.g. on Windows).
  • Behavioral Change: fixPath now accepts an options object for env, platform, and readPath overrides and writes PATH back to the provided env rather than always process.env.
Macroscope summarized ccb8b25.

Note

Medium Risk Changes process environment hydration on Linux and alters default shell selection behavior, which can impact CLI discovery and startup behavior across platforms. Risk is moderate due to OS-specific variability, but changes are guarded to only run on darwin/linux with added regression tests.

Overview Fixes Linux packaged startup CLI detection by extending login-shell environment hydration to Linux in both desktop (syncShellEnvironment) and server (fixPath) startup.

Adds shared resolveLoginShell helper to choose a platform-appropriate default shell (/bin/zsh on macOS, /bin/bash on Linux) and no-op on unsupported platforms, and adds tests verifying PATH/SSH_AUTH_SOCK hydration plus that server fixPath runs before server start.

Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ccb8b259acaff86a0cb7a189c82c817be1bbf7c1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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

      Run ID: 3e2e068f-20a6-464f-b122-c431d1781c2a

      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 and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. I independently hit the same issue on Ubuntu 22.04 with the AppImage (v0.0.11) and arrived at the same fix. Tested locally with codex installed via nvm (Node v24) — after applying the platform guard change + moving fixPath() before Layer construction, the Codex provider status correctly shows "ready".

      One note: since #972 landed, the desktop side was refactored from fixPath.ts to syncShellEnvironment.ts, so the platform guard change now needs to go in that file instead. The server-side os-jank.ts is unchanged.

    4. One note: since #972 landed, the desktop side was refactored from fixPath.ts to syncShellEnvironment.ts, so the platform guard change now needs to go in that file instead. The server-side os-jank.ts is unchanged.

      Might need to rebase and refactor then. Thanks for letting me know!

    5. One note: since #972 landed, the desktop side was refactored from fixPath.ts to syncShellEnvironment.ts, so the platform guard change now needs to go in that file instead. The server-side os-jank.ts is unchanged.

      Might need to rebase and refactor then. Thanks for letting me know!

      You're welcome! If you need any help, let me know! I really want this fix to land, so that I can normally use the app on Linux

    6. Rebased onto main and simplified the implementation:

      • The fix now lives in syncShellEnvironment.ts instead of the removed fixPath.ts (as noted, #972 refactored the desktop side)
      • Added resolveLoginShell() helper to @t3tools/shared/shell for platform-aware shell resolution (darwin → zsh, linux → bash)
      • Desktop: syncShellEnvironment now supports both macOS and Linux
      • Server: fixPath() uses the same resolveLoginShell helper directly
      • Removed the redundant readPathForDesktopRuntime wrapper — both desktop and server compose the primitives directly

      All typechecks and tests pass.

    7. Cursor Bugbot has reviewed your changes and found 2 potential issues.

      Fix All in Cursor Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard?tab=bugbot).
    8. juliusmarminge merged this32c1f98

    9. juliusmarminge closed this

Sign in to join this conversation.