fix: enable fixPath() on Linux and call it before health check#1140
fix: enable fixPath() on Linux and call it before health check#1140arthurbm wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can use your project's `biome` configuration to improve the quality of JS/TS/CSS/JSON code reviews.Add a configuration file to your project to customize how CodeRabbit runs |
On Linux (AppImage), the Codex CLI health check always fails with "not installed or not on PATH" because: 1. fixPath() guards with `platform !== "darwin"`, skipping Linux entirely 2. In the server, fixPath() runs inside Effect.gen (after Layer construction), but ProviderHealthLive fires during Layer construction Change the guard to `=== "win32"` so Linux gets PATH normalization, and call fixPath() at module top-level in the server — mirroring apps/desktop/src/main.ts which already does this correctly.
d7632b9 to
16dc57c
Compare
What Changed
apps/desktop/src/syncShellEnvironment.tsandapps/server/src/os-jank.ts: changed platform guard from!== "darwin"to=== "win32"apps/server/src/main.ts: added top-levelfixPath()call before any Layer construction~5 lines changed across 3 files.
Why
On Linux (AppImage), the Codex provider health check always fails with "Codex CLI (
codex) is not installed or not on PATH" even whencodexis installed and works from the terminal.Two issues combine to cause this:
syncShellEnvironment()/fixPath()skip Linux entirely — both files guard withprocess.platform !== "darwin", soreadPathFromLoginShell()/readEnvironmentFromLoginShell()(which already work on Linux) are never called. On Linux AppImage the process inherits a minimal PATH that doesn't include user shell paths like~/.nvm/versions/node/*/bin.Server calls
fixPath()too late — it runs insideEffect.gen(line 243) butProviderHealthLiveis constructed as a Layer (line 200) which executes before the Effect body. The health check (codex --version) fires with the unfixed PATH.apps/desktop/src/main.tsalready callssyncShellEnvironment()at module top-level — the server just needs to match this pattern.See #1139 for full details and reproduction steps.
Testing
codex) is not installed or not on PATH"=== "win32"guard)Checklist
Closes #1139