Skip to content

fix: enable fixPath() on Linux and call it before health check#1140

Open
arthurbm wants to merge 1 commit intopingdotgg:mainfrom
arthurbm:fix/linux-fixpath-health-check
Open

fix: enable fixPath() on Linux and call it before health check#1140
arthurbm wants to merge 1 commit intopingdotgg:mainfrom
arthurbm:fix/linux-fixpath-health-check

Conversation

@arthurbm
Copy link

@arthurbm arthurbm commented Mar 16, 2026

What Changed

  • apps/desktop/src/syncShellEnvironment.ts and apps/server/src/os-jank.ts: changed platform guard from !== "darwin" to === "win32"
  • apps/server/src/main.ts: added top-level fixPath() 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 when codex is installed and works from the terminal.

Two issues combine to cause this:

  1. syncShellEnvironment() / fixPath() skip Linux entirely — both files guard with process.platform !== "darwin", so readPathFromLoginShell() / 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.

  2. Server calls fixPath() too late — it runs inside Effect.gen (line 243) but ProviderHealthLive is 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.ts already calls syncShellEnvironment() at module top-level — the server just needs to match this pattern.

See #1139 for full details and reproduction steps.

Testing

  • Verified on Ubuntu 22.04 with T3 Code AppImage v0.0.11, Node v24 via nvm, codex-cli 0.114.0
  • Before fix: "Codex CLI (codex) is not installed or not on PATH"
  • After fix: Codex provider status shows ready
  • macOS behavior unchanged (same logic, just wider platform gate)
  • Windows still skipped (=== "win32" guard)

Checklist

  • This PR is small and focused
  • I explained what changed and why

Closes #1139

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 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: 01e478fb-a4bf-4b55-bf11-c00129d5d621

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
  • Post copyable unit tests in a comment
📝 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 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 biome.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 16, 2026
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.
@arthurbm arthurbm force-pushed the fix/linux-fixpath-health-check branch from d7632b9 to 16dc57c Compare March 16, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex CLI not found on Linux: fixPath() skips non-macOS and runs after health check

1 participant