Skip to content

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

@arthurbm

Description

@arthurbm

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server, apps/desktop

Steps to reproduce

  1. Install T3 Code on Linux via AppImage (v0.0.11)
  2. Have codex installed via nvm (e.g. npm install -g @openai/codex)
  3. Open the app and add a project
  4. Observe the Codex provider status

Expected behavior

Codex provider status should show "ready" or an authentication status, since codex is installed and works from the terminal.

Actual behavior

The app shows:

Codex CLI (codex) is not installed or not on PATH.

Root cause

Two issues combine to cause this:

1. Shell environment sync only runs on macOS

Both apps/desktop/src/syncShellEnvironment.ts and apps/server/src/os-jank.ts have:

if (process.platform !== "darwin") return;

This skips PATH normalization entirely on Linux. On Linux (especially AppImage), the process environment doesn't include user shell paths (e.g. ~/.nvm/versions/node/*/bin), so CLIs installed via nvm/bun are not found.

2. Server calls fixPath() after the health check

In apps/server/src/main.ts, fixPath() is called inside Effect.gen at line 243:

yield* cliConfig.fixPath;

But ProviderHealthLive is constructed as a Layer (line 200), which runs before the Effect.gen body. The health check (codex --version) fires with the old PATH before fixPath() has a chance to correct it.

Note: apps/desktop/src/main.ts already calls syncShellEnvironment() at module top-level, which is the correct pattern.

Proposed fix

  1. Change platform guard from !== "darwin" to === "win32" in both syncShellEnvironment.ts and os-jank.ts
  2. Add a top-level fixPath() call in apps/server/src/main.ts (mirroring the desktop app pattern)

This is a ~5-line change across 3 files. The readPathFromLoginShell() / readEnvironmentFromLoginShell() utilities already work on Linux — they just were never called.

Impact

Complete failure — Codex provider is unusable on Linux.

Version or commit

v0.0.11 / main (as of commit e6d9a27)

Environment

  • Ubuntu 22.04.5 LTS (kernel 6.8.0-106-generic)
  • T3 Code AppImage v0.0.11
  • Node v24.14.0 via nvm
  • codex-cli 0.114.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions