Repository navigation
fix(plugin): find the Codex CLI the desktop app ships - #383
Conversation
Plugin commands ran the bare name `codex` from PATH, so a machine with only the Codex desktop app, or a scheduled job started with a minimal PATH, reported the CLI as missing. The account-only `cli` override did not help: the default codex target cannot set it, and an absolute path in a config shared between macOS and Windows is wrong on one of them. When `codex` is not on PATH, look in Homebrew's folders and the CLI the app installs (Codex.app on macOS, %LOCALAPPDATA%\OpenAI\Codex\bin on Windows). SKILLSHARE_CODEX_CLI overrides the search on one machine without touching the synced config. The missing-CLI error now lists every place searched, in the CLI and the dashboard. Refs #338
The plugin reference and the sharing guide still said every native CLI must be on PATH, and the built-in skill told agents a missing CLI has no fallback. Codex now has one, plus a machine-local override that agents should prefer over a path in a shared config. Refs #338
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8944ea638c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Since the Codex desktop app merged with ChatGPT, macOS installs it as ChatGPT.app, so an app-only Mac with a minimal PATH still reported Codex as missing. Try ChatGPT.app before Codex.app in /Applications and ~/Applications, the order Codex's own desktop-app finder uses. Refs #338
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76b11ec51e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ChatGPT Desktop 26.924 removed Contents/Resources/codex and ships the CLI at the entrypoint its package manifest declares, codex-cli/bin/codex, so a current app-only Mac still reported Codex as missing. Try that entrypoint first in each app bundle and keep the old path for earlier builds. Refs #338
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8d7fb4408
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return paths | ||
| case "windows": | ||
| if f.localAppData != "" { | ||
| return []string{filepath.Join(f.localAppData, "OpenAI", "Codex", "bin", "*", "codex.exe")} |
There was a problem hiding this comment.
Include the official Windows standalone install path
When Codex is installed with the official PowerShell installer and Skillshare runs from a scheduled job with a minimal PATH, this branch searches only the desktop app's relocated runtime. The official installer defaults its visible executable to %LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe, so this supported installation is reported as missing unless the user also configures SKILLSHARE_CODEX_CLI. Include that fixed path among the Windows candidates so the minimal-PATH fallback covers the standard standalone installation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 1f09925. Windows now tries %LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe (the installer's defaultVisibleBinDir) before the desktop app's copy, mirroring Homebrew before the app bundle on macOS. Covered by TestCodexFinderPrefersWindowsInstaller; TestCodexFinderListsWhereItLooked now expects it in the searched places. The environment-variable docs and the built-in skill list it.
The official PowerShell installer puts codex.exe in %LOCALAPPDATA%\Programs\OpenAI\Codex\bin and adds it to the user PATH. A job started without that PATH missed it, the same gap Homebrew's folders cover on macOS. Try it before the desktop app's copy. Refs #338
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f09925f60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if bin != "codex" { | ||
| return run(ctx, dir, env, bin, args...) |
There was a problem hiding this comment.
Preserve an explicit account CLI named codex
When a Codex account explicitly configures the valid bare executable cli: codex, this condition still enters the machine-wide finder, so SKILLSHARE_CODEX_CLI or a bundled app executable can replace the account's configured CLI. This contradicts the documented contract that an account with its own cli is not searched and can make that account run a different Codex binary; track whether account.CLI was supplied rather than inferring it from the resulting string.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 6205a54. Service.run now searches only when the account sets no cli; an explicit cli: codex runs as written. TestCodexAccountCLIIsNotSearched now uses the bare name codex (it used an absolute path before, which never reached the search) and failed before the change.
The Codex search ran whenever the executable was the bare name codex, so an account that set cli: codex could get SKILLSHARE_CODEX_CLI or the app's CLI instead, against the documented rule that an account's own cli is kept. Search only when no account cli is set. Refs #338
Type
proposals/only — see CONTRIBUTING.md)Linked Issue
Refs #338
Summary
Plugin commands ran the bare name
codexfromPATH. A machine with only the Codex desktop app, or a scheduled job with a minimalPATH, reported the CLI as missing, and the account-onlyclioverride could not help the defaultcodextarget or a config shared between macOS and Windows.codexis not onPATH, Skillshare now tries Homebrew (/opt/homebrew/bin,/usr/local/bin) and the CLI the Codex app ships:Codex.app/Contents/Resources/codexin/Applicationsor~/Applicationson macOS, and%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exeon Windows (newest one).SKILLSHARE_CODEX_CLIoverrides the search on one machine, without touching the synced config.cliis unchanged.plugins.error.codexMissingwith alookedargument), in the CLI and in the dashboard's "Not installed" group, which now expands to show it. Translated in all 11 locales.Verification
make checkin the devcontainer: passed.vitest run873/873 (one earlier run had a single failure whilemake checkran in parallel; two reruns passed),pnpm run buildpassed.docusaurus buildfor en, zh-Hant, zh-Hans, ja and ko, no broken links or anchors.PATHreduced to system folders as a scheduled job would have,ss plugin list --json:ready,codex-cli 0.160.0, its bundled plugins listedSKILLSHARE_CODEX_CLI=C:\nope\codex.exe:missing, error names the variablemissing, error listsPATHand the%LOCALAPPDATA%patternChecklist
make check) — for code changes