You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex: should a newer codex win over an older one earlier on PATH? #73
An older codex earlier on PATH than a current one breaks every Codex call. It doesn't matter how the old copy got there: npm, Homebrew, a release binary, or a stale leftover.
find_program (crates/grida-fx-providers/src/codex/mod.rs) takes the first executable codex on PATH. It never checks the version. The app-bundle location is tried only when PATH has no codex at all.
An old copy rejects codex mcp list --json. The runtime then refuses every Codex call in the run with Codex's MCP servers could not be listed, so they cannot be turned off. That sentence points at MCP servers, not at an outdated program.
grida fx doctor still reports imagegen@codex servable, because it checks only that the program exists (Servable::NoProgram).
The user sees a misleading refusal from the run and a healthy report from doctor. Nothing points to the real cause.
Fix
(a) A version check that works however Codex was installed
Read codex --version once when the runtime starts, and in doctor.
Require at least the version the behaviour was verified on (0.160.1, per spec/providers.md §9.6).
Refuse an older or unreadable version with a reason that names the version and where it was found. For example: Codex <version> (from PATH) is older than 0.160.1: update it, or set GRIDA_FX_TOOL_CODEX.
Have doctor show which copy it chose (GRIDA_FX_TOOL_CODEX, PATH or the app bundle) and its version, as well as whether it is servable.
(b) A separate spec decision: should a newer copy win over an older one on PATH?
For example, should the ChatGPT app's bundled codex be preferred to an older one on PATH? That changes the lookup order in §9.6, so it is a spec change first. It is also independent of (a): (a) alone turns the silent failure into a clear refusal.
Related
Still open in TODO.md ("Codex-backed image generation", follow-ups):
Windows: npm installs codex.cmd, which find_program does not look for.
changed the title [-]Codex: an older codex earlier on PATH is used, refused with a misleading reason, and doctor calls it servable[/-][+]Codex: should a newer codex win over an older one earlier on PATH?[/+]on Oct 13, 2026
Part (a) shipped in #84: FX asks codex --version before anything else and refuses a Codex older than 0.160.1, saying which version it found and where (GRIDA_FX_TOOL_CODEX, PATH or the ChatGPT app). grida fx doctor shows the copy it chose, its path and version, and marks the route too old.
Part (b), preferring a newer copy over an older one earlier on PATH, is not planned. The old copy is now easy to spot and needs fixing only once: update it, or set GRIDA_FX_TOOL_CODEX. Choosing a newer copy automatically would mean FX runs a different codex than your shell does, and asks every copy its version on every run. If FX ever needs to handle more than one copy, the program lookup shared by every runtime (#72) is the place to do it.
Activity
Refuse an older Codex by its version, and show which Codex doctor found
Refuse an older Codex by its version, and show which Codex doctor fou…
[-]Codex: an older codex earlier on PATH is used, refused with a misleading reason, and doctor calls it servable[/-][+]Codex: should a newer codex win over an older one earlier on PATH?[/+]softmarshmallow commentedon Oct 13, 2026
Part (a) shipped in #84: FX asks
codex --versionbefore anything else and refuses a Codex older than 0.160.1, saying which version it found and where (GRIDA_FX_TOOL_CODEX,PATHor the ChatGPT app).grida fx doctorshows the copy it chose, its path and version, and marks the routetoo old.Part (b), preferring a newer copy over an older one earlier on
PATH, is not planned. The old copy is now easy to spot and needs fixing only once: update it, or setGRIDA_FX_TOOL_CODEX. Choosing a newer copy automatically would mean FX runs a differentcodexthan your shell does, and asks every copy its version on every run. If FX ever needs to handle more than one copy, the program lookup shared by every runtime (#72) is the place to do it.