Skip to content

Fix CodexTextGeneration to use configured codex binary path #1361

@DJProspero1

Description

@DJProspero1

Description

The CodexTextGeneration layer (used for generating commit messages, PR content, and branch names) hardcodes "codex" as the binary name in ChildProcess.make(). When the codex CLI is not on PATH (e.g., installed via fnm, homebrew, or at a custom path), text generation fails with a spawn codex ENOENT error.

The app already has a codexBinaryPath setting in AppSettings, and it correctly flows to codexAppServerManager via providerOptions. However, this setting is not passed to the CodexTextGeneration layer, so git text generation always spawns bare codex.

Error

PlatformError: NotFound: ChildProcess.spawn (codex exec --ephemeral -s read-only --model gpt-5.4-mini ...)
[cause]: Error: spawn codex ENOENT

Fix

Thread codexBinaryPath from app settings through the same path as textGenerationModel:

  1. Add codexBinaryPath to GitRunStackedActionInput contract
  2. Pass it from client app settings through gitReactQuery mutation options
  3. Add it to CommitMessageGenerationInput, PrContentGenerationInput, BranchNameGenerationInput
  4. Use it in CodexTextGeneration.runCodexJson() instead of hardcoded "codex"

Affected files

  • packages/contracts/src/git.ts
  • apps/web/src/lib/gitReactQuery.ts
  • apps/web/src/components/GitActionsControl.tsx
  • apps/server/src/git/Services/TextGeneration.ts
  • apps/server/src/git/Layers/CodexTextGeneration.ts
  • apps/server/src/git/Layers/GitManager.ts

Related issues

Related to #693 (healthcheck also ignores binary path settings)
Related to #246, #234, #269 (codex binary not found in various environments)

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