Skip to content

Fix Linux desktop Codex CLI detection at startup#1100

Open
Ryan-D-Gast wants to merge 1 commit intopingdotgg:mainfrom
Ryan-D-Gast:fix/linux-desktop-codex-path
Open

Fix Linux desktop Codex CLI detection at startup#1100
Ryan-D-Gast wants to merge 1 commit intopingdotgg:mainfrom
Ryan-D-Gast:fix/linux-desktop-codex-path

Conversation

@Ryan-D-Gast
Copy link

@Ryan-D-Gast Ryan-D-Gast commented Mar 15, 2026

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 PATH hydration to Linux desktop startup

  • Adds a new resolveLoginShell utility in packages/shared/src/shell.ts that returns the user's shell or a platform default (/bin/zsh on macOS, /bin/bash on Linux), returning undefined on unsupported platforms.
  • Updates fixPath in apps/server/src/os-jank.ts and syncShellEnvironment in apps/desktop/src/syncShellEnvironment.ts to use resolveLoginShell instead of a macOS-only guard, enabling PATH and SSH_AUTH_SOCK hydration on Linux.
  • Moves PATH hydration into a new PathHydrationLive layer in apps/server/src/main.ts, running it earlier in the dependency graph before other service layers initialize.
  • Behavioral Change: PATH hydration now runs on Linux in addition to macOS; on unsupported platforms it exits early without changes.

Macroscope summarized b2c097d.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

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: 0592598b-1f5e-41c0-b581-fb1dcce495c9

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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

@arthurbm
Copy link

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.

@Ryan-D-Gast
Copy link
Author

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!

@arthurbm
Copy link

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

@Ryan-D-Gast Ryan-D-Gast force-pushed the fix/linux-desktop-codex-path branch from 4bbf969 to 5d7d29b Compare March 18, 2026 19:35
@Ryan-D-Gast Ryan-D-Gast force-pushed the fix/linux-desktop-codex-path branch from 5d7d29b to b2c097d Compare March 18, 2026 19:38
@Ryan-D-Gast
Copy link
Author

Rebased onto main and simplified the implementation:

  • The fix now lives in syncShellEnvironment.ts instead of the removed fixPath.ts (as noted, fix(desktop): backfill SSH_AUTH_SOCK from login shell on macOS #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

2 participants