Codex CLI keeps prompting to update after successful update (0.141.0 → 0.142.4)

Bug: Codex CLI keeps prompting to update from 0.141.0 to 0.142.4 after a successful update

Environment

  • OS: Windows 11

  • Installation: Portable (Node.js + npm + Codex are all located under C:\CodexDebug\node)

  • Launcher:

    .\node\codex.cmd
    

Problem

Every time I start Codex CLI, it reports:

Update available

0.141.0 -> 0.142.4

I choose Update, it reports success and asks me to restart Codex.

However, after restarting, the exact same update notification appears again.

This happens every time.


Investigation

1. npm reports that the latest package is already installed

Command:

.\node\npm.cmd list -g @openai/codex

Output:

@openai/codex@0.142.4

So npm confirms the latest version is already installed.


2. npm global prefix points to the portable installation

Command:

.\node\npm.cmd config get prefix

Output:

C:\CodexDebug\node

This confirms the update is installed into the portable directory rather than another global location.


3. codex.cmd launches the package from the same portable directory

Command:

Get-Content .\node\codex.cmd

The launcher executes:

node_modules\@openai\codex\bin\codex.js

Therefore the executable is using:

C:\CodexDebug\node\node_modules\@openai\codex

which is the same directory npm updated.


4. package.json also reports the latest version

Command:

Get-Content .\node\node_modules\@openai\codex\package.json | Select-String version

Output:

"version": "0.142.4"

So the installed package itself is definitely version 0.142.4.


5. But Codex CLI still reports itself as 0.141.0

Command:

.\node\codex.cmd --version

Output:

codex-cli 0.141.0

In addition, every launch still shows:

Update available

0.141.0 -> 0.142.4

Expected

After updating:

  • codex --version should report 0.142.4
  • The update notification should disappear.

Actual

  • npm package version is already 0.142.4.
  • package.json is already 0.142.4.
  • codex.cmd launches the updated package.
  • codex --version still reports 0.141.0.
  • Every startup still prompts to update.

Conclusion

This appears to be an issue with the CLI’s version detection or update-check logic.

The installed package has already been updated successfully, but the CLI still believes it is running version 0.141.0, causing a false update notification on every launch.

It looks like the update checker and the installed package are reading different version sources.

Welcome to the forum!

You are welcome to discuss Codex issues on the forum, however the official place to report and track them is the GitHub issue tracker for OpenAI Codex.

I had ChatGPT look for the closest related issue and it did not find an exact match. As this problem has lots of variation I did not manually look further.

Try searching the existing GitHub issues for a match. If you cannot find one, then open a new issue with as much detail as possible.

If an issue matches your problem, consider adding a :+1: reaction on the GitHub issue page itself, as reactions on GitHub help the developers gauge impact and prioritize work.

This looks like a launcher/version-source mismatch more than a failed npm update.

I would check three things separately:

  1. What the launcher actually starts:

.\node\codex.cmd

Get-Content .\node\codex.cmd

  1. What package version npm sees:

.\node\npm.cmd list -g @openai/codex --depth=0

.\node\npm.cmd root -g

  1. What Codex itself reports when launched through the exact portable Node path:

.\node\node.exe .\node\node_modules\@openai\codex\bin\codex.js --version

If npm says 0.142.4 but the CLI still reports 0.141.0, the updater may be writing to the right global prefix while the launcher reads a stale/cached entrypoint or a different version source.

Could you paste the output of those three checks? Especially the contents of codex.cmd and the version from the direct node.exe command.

Hey @Raym It’s been a while since your report.

Codex’s npm launcher starts a separate Windows executable, so the package version alone doesn’t confirm that executable updated.

Close Codex, then try the current npm release from C:\CodexDebug:

  • .\node\npm.cmd install -g @openai/codex@latest
  • .\node\codex.cmd --version

If the loop continues, contact support@openai.com .

-Sanket