Skip to content

fix(codex): point codex-acp at the global codex CLI via CODEX_PATH - #1616

Open
chaodu-agent wants to merge 1 commit into
mainfrom
fix/codex-acp-codex-path-1611
Open

chaodu-agent wants to merge 1 commit into
mainfrom
fix/codex-acp-codex-path-1611

Conversation

@chaodu-agent

Copy link
Copy Markdown
Collaborator

Fixes #1611

Root cause

@agentclientprotocol/codex-acp@2.0.0 depends on @openai/codex ^0.158.0. When the image installs @openai/codex@0.166.0 globally, npm nests a separate @openai/codex@0.158.0 under codex-acp. codex-acp uses that nested copy unless CODEX_PATH is set, so the agent runs an older CLI than the one the image installs.

Change

Each of the three Dockerfiles that install the codex stack gets one line after the npm install -g step:

ENV CODEX_PATH=/usr/local/bin/codex
  • Dockerfile.codex
  • Dockerfile.package (codex stage)
  • Dockerfile.unified (codex stage)

No other files change.

Verification

Run by a previous step on macmini (arm64):

  • The codex target builds, exit 0.
  • Inside the image, codex --version prints 0.166.0.
  • CODEX_PATH resolves to the 0.166.0 CLI at /usr/local/bin/codex.
  • A codex-acp probe spawns the global 0.166.0 binary, not the nested 0.158.0 copy.

Review Contract

Goal

codex-acp in the OpenAB codex images must run the global @openai/codex CLI that the image installs (0.166.0), not the older copy npm nests under codex-acp.

Non-goals

  • No change to the pinned CODEX_ACP_VERSION or CODEX_VERSION values.
  • No change to how npm resolves dependencies, and no overrides in a package manifest.
  • No fix for the x86_64 build path. It is not run in this PR.
  • No correction to docs/codex.md. That file still states a dedup claim that is wrong. Fixing it is out of scope here.

Accepted Residual Risks

  • The x86_64 image build was not run. The change is an ENV line with the same content on each architecture, so the risk is low, but it has not been observed on x86_64.
  • The smoke test does not yet check the resolved codex-acp version. A future codex-acp release that changes how it locates the CLI would not be caught by CI. Mitigation: the runtime probe above, and the pinned CODEX_ACP_VERSION. Recovery: revert the three lines.
  • If CODEX_PATH is missing from an image, codex-acp falls back to the nested copy. That is the behavior before this PR, so no new failure mode is added.

Acceptance Criteria

  1. Each of the three Dockerfiles contains ENV CODEX_PATH=/usr/local/bin/codex in its codex stage, and the diff against origin/main has no other changes.
  2. The codex target builds successfully (verified on arm64).
  3. In the built image, codex --version reports 0.166.0, and CODEX_PATH resolves to that binary.
  4. A codex-acp probe spawns the global 0.166.0 binary, not the nested 0.158.0 copy.

Follow-ups

  • Add a smoke-test assertion that the resolved codex-acp CLI matches CODEX_VERSION.
  • Correct the dedup claim in docs/codex.md.
  • Run the x86_64 build and probe before the next image release.

codex-acp 2.0.0 depends on @openai/codex ^0.158.0, so npm nests a 0.158.0 copy under codex-acp and spawns it when CODEX_PATH is unset. Set CODEX_PATH to the global codex bin (/usr/local/bin/codex, the npm global bin of the node base image) in the codex stage of Dockerfile.unified, Dockerfile.codex and Dockerfile.package. Not built or run in this commit.

This branch has not been deployed

No deployments
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.

beta-codex ARM64: Codex ACP uses CLI 0.158.0 despite global CLI 0.166.0

1 participant