Skip to content

Codex: should a newer codex win over an older one earlier on PATH? #73

Closed as not planned

Description

@softmarshmallow

What happens

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.
    • Other app-bundle locations are not searched.
  • Grok Build image backend (SuperGrok, over its native ACP): plan #72 Phase 1 replaces this lookup with a program lookup and version check shared by every runtime the user installs. That will cover (a) for Codex and Grok Build alike.

Activity

  1. 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
  2. softmarshmallow commented on Oct 13, 2026

    @softmarshmallow
    MemberAuthor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions