Skip to content

fix(config): prefer user-local codex binaries by default#92

Open
kesslerio wants to merge 2 commits into
pwrdrvr:mainfrom
kesslerio:fix/portable-codex-command-resolution
Open

fix(config): prefer user-local codex binaries by default#92
kesslerio wants to merge 2 commits into
pwrdrvr:mainfrom
kesslerio:fix/portable-codex-command-resolution

Conversation

@kesslerio
Copy link
Copy Markdown

@kesslerio kesslerio commented Apr 11, 2026

What

  • keep an explicit command setting untouched
  • preserve PATH order when the plugin has to choose a default codex binary
  • keep the existing fallback to common user-local bin directories when PATH does not already point at one
  • add a regression for multiple home-local codex candidates

Why

The earlier version of this PR fixed one real problem and introduced another. It would prefer XDG_BIN_HOME, ~/.local/bin, or ~/bin ahead of later home-local entries already present in PATH. That means a machine with both ~/.local/bin/codex and something like ~/.asdf/shims/codex could still launch the wrong binary.

This keeps the original scope. The plugin only changes its default when command is missing, but it now respects the user's PATH order instead of guessing.

Tests

  • pnpm test src/config.test.ts
  • pnpm typecheck
  • pnpm test

AI assistance

Codex drafted the patch and test update. I reviewed the diff, the failure mode, and the test results before pushing the branch.

Related

@huntharo
Copy link
Copy Markdown
Contributor

Thank you for your contribution!

Unfortunately there are still changes needed to support such an ambitious plugin in OpenClaw. Some of this functionality is now being included directly in OpenClaw.

I have made a new project, https://github.com/pwrdrvr/PwrAgent, that gives you a Codex Desktop replacement app (uses Codex) but also integrates with messaging with openclaw-codex-app-server-like functionality.

PwrAgent gives you a visual Settings dialog that shows you the versions of Codex that have been discovered and lets you override the discovered versions if desired.

Granted... I am thinking you might be on Linux and not on a Mac? In theory... we can make this work on Linux... it's an Electron app. If you'd be willing to try it I'll see about getting the app published for Linux.

image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants