What version of Codex CLI is running?
codex-cli 0.130.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal 1.24.11321.0 PowerShell 7.6.1 No terminal multiplexer.
Codex doctor report
not available
`codex doctor --json` does not appear to be supported in codex-cli 0.130.0. Running it returns:
error: unexpected argument '--json' found
What issue are you seeing?
When running codex update from inside an active Codex CLI session on Windows, Codex updates via npm install -g @openai/codex, but npm then emits cleanup warnings because it cannot remove a temporary install directory containing codex.exe.
Observed output:
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG',
npm warn cleanup [Error: EPERM: operation not permitted, unlink 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG
\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'unlink',
npm warn cleanup path: 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG\node_modules\@openai\codex-win32-x64
\vendor\x86_64-pc-windows-msvc\codex\codex.exe'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
The update appears to complete, but the warning is confusing and leaves temporary .codex-* install directories behind.
What steps can reproduce the bug?
- On Windows, open Codex CLI in Windows Terminal / PowerShell.
- Start or continue an interactive Codex CLI session.
- Run
codex update through Codex.
- Observe that the update invokes
npm install -g @openai/codex.
- After installation, npm emits cleanup warnings with
EPERM: operation not permitted, unlink ... codex.exe.
Uploaded thread: 019e3b9c-2a56-7412-a69d-9df4d7172591
What is the expected behavior?
codex update should work as a Windows-safe self-update without producing npm cleanup warnings and without leaving temporary .codex-* directories behind.
If the running Codex process prevents immediate cleanup, the updater should use a Windows-safe strategy such as a separate updater process, side-by-side versioned install, deferred cleanup, or another mechanism that does not try to remove the active codex.exe.
Additional information
This seems specific to the self-update path on Windows. Other tools avoid this class of issue by delegating the update to a separate process, using versioned side-by-side installs, or deferring cleanup until the running executable is no longer locked.
What version of Codex CLI is running?
codex-cli 0.130.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal 1.24.11321.0 PowerShell 7.6.1 No terminal multiplexer.
Codex doctor report
What issue are you seeing?
When running
codex updatefrom inside an active Codex CLI session on Windows, Codex updates vianpm install -g @openai/codex, but npm then emits cleanup warnings because it cannot remove a temporary install directory containingcodex.exe.Observed output:
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG',
npm warn cleanup [Error: EPERM: operation not permitted, unlink 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG
\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'unlink',
npm warn cleanup path: 'C:\Users\\AppData\Roaming\npm\node_modules\@openai\.codex-l0XzpfJG\node_modules\@openai\codex-win32-x64
\vendor\x86_64-pc-windows-msvc\codex\codex.exe'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
The update appears to complete, but the warning is confusing and leaves temporary
.codex-*install directories behind.What steps can reproduce the bug?
codex updatethrough Codex.npm install -g @openai/codex.EPERM: operation not permitted, unlink ... codex.exe.Uploaded thread: 019e3b9c-2a56-7412-a69d-9df4d7172591
What is the expected behavior?
codex updateshould work as a Windows-safe self-update without producing npm cleanup warnings and without leaving temporary.codex-*directories behind.If the running Codex process prevents immediate cleanup, the updater should use a Windows-safe strategy such as a separate updater process, side-by-side versioned install, deferred cleanup, or another mechanism that does not try to remove the active
codex.exe.Additional information
This seems specific to the self-update path on Windows. Other tools avoid this class of issue by delegating the update to a separate process, using versioned side-by-side installs, or deferring cleanup until the running executable is no longer locked.