Skip to content

[Windows][26.901.1978.0] cua_node rename_staging EPERM loops indefinitely, freezes desktop UI, and consumes ~59 GB #42484

Open

Description

@kidplayeva

Codex version

  • Codex desktop: 26.901.1978.0 (Microsoft Store/MSIX, x64)
  • Bundled Codex CLI: 0.153.0-alpha.5
  • A similar relocation failure also occurred after updating version 26.820.7780.

Environment

  • Windows 11 Pro 25H2, build 26200.8457, AMD64
  • Runtime root: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node
  • Affected runtime content ID: ad3b5049246cde44

Description

After an app update, Codex desktop starts but becomes extremely slow and eventually enters Windows' "Not responding" state. This is not ordinary renderer lag: the desktop main process repeatedly tries to materialize its bundled Node runtime and fails at the final staging-directory rename with Windows EPERM.

Each failed attempt creates another large .staging-* directory. In this incident, the loop produced 591 staging directories and consumed 58.96 GB before remediation. The retries were approximately three seconds apart. Windows also recorded MoAppHang for the app.

Sanitized log evidence

event=bundled_executable_relocation_failed
destinationPath=%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\ad3b5049246cde44
errorCode=EPERM
operation=rename_staging
executableName=node.exe   # also observed for node_repl.exe
originalError={"errno":-4048,"code":"EPERM","syscall":"rename",
  "path":"%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\.staging-ad3b5049246cde44-<uuid>",
  "dest":"%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\ad3b5049246cde44"}

The relocation failure is followed by errors equivalent to:

Unable to locate the Codex CLI binary / bundled Node runtime

Reproduction sequence

  1. Update Codex desktop on Windows and launch it.
  2. The app reports an Electron/PATH-related startup error; retrying can eventually open the UI.
  3. The UI then freezes or becomes unresponsive.
  4. Observe %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node while the app is running.
  5. A new .staging-ad3b5049246cde44-* directory appears roughly every three seconds, while the finalized ad3b5049246cde44 directory never appears.
  6. Disk usage and main-process blocking continue to grow until Codex is terminated.

Implementation-level findings

Inspection of the installed desktop bundle indicates this failure is amplified by the materialization logic:

  • The app recursively copies the bundled runtime synchronously, then calls a synchronous directory rename from staging to the content-addressed final directory.
  • If the rename throws, staging cleanup is attempted, but any cleanup failure is swallowed.
  • The resolved-runtime cache is populated only after successful finalization, so a transient failure is not remembered.
  • Separate startup consumers request node.exe, node_repl.exe, and node_modules; after each failure they can re-enter the full copy-and-rename path.
  • There is no bounded retry, exponential backoff, lock coordination, or failure circuit breaker for transient EPERM.
  • Because recursive copy/rename work is synchronous in the desktop main process, the retry loop directly contributes to UI hangs.

This explains both the repeated staging-directory creation and the user-visible freeze. The initial process that briefly held the file/directory handle cannot be proven retroactively without ProcMon/ETW data, but the persistent app hang and disk exhaustion are caused by the unbounded failure/retry behavior.

Recovery verification

With Codex fully stopped, constructing the complete runtime in a single staging directory and atomically renaming it to ad3b5049246cde44 succeeded. After restarting:

  • the staging-directory count remained at 0;
  • bundled Node (v24.19.0) was usable;
  • Codex processes remained responsive;
  • no new hang/crash events appeared;
  • the desktop UI became immediately smooth again.

Deleting the orphaned staging directories recovered 58.96 GB. No Codex settings or project data were removed.

Expected behavior

  • Treat EPERM during final rename as a transient Windows sharing/scan condition and retry the rename itself with bounded exponential backoff and jitter.
  • Coordinate concurrent runtime requests so only one materialization is in flight per content ID.
  • Never repeat the entire synchronous recursive copy every few seconds from the main process.
  • Surface cleanup failures and reliably remove orphaned staging directories on the next launch.
  • Add a retry/circuit-breaker limit so runtime relocation cannot indefinitely freeze the UI or exhaust the system drive.

Related reports

Only sanitized excerpts are included here; raw logs may contain local paths and account/session metadata.

Activity

  1. added
    bug
    app
    windows-os
    on Sep 3, 2026
  2. WilliamClifton-dev commented on Sep 3, 2026

    @WilliamClifton-dev

    Additional reproduction from a Windows user on Codex Desktop 26.901.1978.0 (Microsoft Store/MSIX):

    • The first launch after the update showed the same headless state described here: background ChatGPT.exe processes were present, but no usable window appeared.
    • The first launch eventually completed after more than ten minutes (roughly a dozen minutes).
    • After that initialization completed, the app was usable and subsequent launches were normal/fast.

    This suggests the runtime materialization/staging path can eventually succeed but blocks window creation for a long time on the first launch. From a user perspective the app appears broken because there is no progress UI or indication that initialization is still running.

  3. JRGavin commented on Sep 7, 2026

    @JRGavin

    This issue is still reproducible with the Windows Codex Desktop package 26.901.6511.0 and bundled app-server 0.153.4.

    After updates, the desktop becomes very slow or unresponsive, with high disk activity. Repeated app restarts sometimes recover it, but the problem returns after later updates. The observed error is EPERM during rename_staging. The primary workspace-runtime updater can also fail its final directory rename and retry a full installation in the background.

    Please fix both installer paths rather than relying on users to clear caches after each update:

    • Keep copying, hashing, and extraction off the desktop UI thread.
    • Serialize installation requests for the same runtime.
    • Retry the final rename with bounded backoff, reusing the verified payload.
    • Stop repeated full installations after a small failure limit and keep the previous working runtime.
    • Provide a pause-runtime-updates setting that preserves installed workspace-dependency features.

    This is a minimal report: no machine paths, account identifiers, session logs, private project data, or attachments are included.

  4. zjt15088176161-arch commented on Sep 9, 2026

    @zjt15088176161-arch

    Additional confirmation on a newer Windows desktop build.

    Environment

    • ChatGPT/Codex package: 26.903.8094.0
    • ChatGPT.exe: 152.0.7977.83
    • Windows 25H2, build 26200.9445, x64

    User-visible behavior

    The entire desktop window intermittently stopped responding: clicks and scrolling did not work, and Windows showed “Not Responding.” Short freezes occurred approximately every few minutes, including while an ordinary conversation was idle with no active task or response streaming. One hang required force-terminating and reopening the app.

    Disabling the Chrome computer-control integration and then the master computer-control permission did not stop the already-running retry loop.

    Correlated diagnostics

    The affected desktop session repeatedly logged:

    bundled_executable_relocation_failed
    errorCode=EPERM
    errorMessage="Bundled executable relocation failed during rename_staging"
    

    for the bundled cua_node runtime (node.exe and node_repl.exe), followed by failures to sync Chrome native-host resources and main_thread_jank_snapshot processRole=browser_main.

    Counts from the affected session:

    • rename_staging / EPERM: 240
    • bundled-plugin reconciliation failures: 61
    • main-thread jank snapshots: 66
    • staging data observed at one point: approximately 4.8 GB

    Windows recorded:

    • AppHangTransient at 23:44:15 local time
    • Application Hang event 1002 / WER MoAppHang at 23:58:46

    The last desktop log line before the terminal hang was another rename_staging / EPERM failure at 23:56:54.597; logging then stopped.

    File-monitor correlation (not proven causation)

    A third-party real-time security/file-monitoring driver was active during the failures. Its uninstall log showed file monitoring still enabled at 23:56:45.826. The last Codex EPERM occurred at 23:56:54.597, and the filter driver removal was logged at 23:56:54.844.

    After the security software was uninstalled, the hung app was force-terminated, and Codex was relaunched:

    • the bundled runtime resolved successfully;
    • bundled-plugin reconciliation completed;
    • a three-minute read-only monitor showed no new EPERM or reconciliation failures;
    • the staging-directory count stayed unchanged;
    • all ChatGPT processes remained responsive;
    • no user-visible freeze occurred during that interval.

    This timing suggests that the file-monitor may have contributed to the initial sharing/rename denial, but it does not prove it was the sole cause. Regardless of the original lock holder, the unbounded retry behavior and synchronous/main-process work appear to amplify a transient Windows filesystem conflict into repeated UI freezes and disk growth.

    Expected behavior remains as described in this issue: bounded retry/backoff, coordination of concurrent runtime materialization, responsive UI, and reliable cleanup of failed staging directories.

  5. kidplayeva commented on Sep 15, 2026

    @kidplayeva
    Author

    Additional deterministic reproduction on a newer Windows desktop build.

    Environment

    • Previous working package: 26.908.4834.0
    • Updated package: 26.908.9136.0 (Microsoft Store/MSIX, x64)
    • Bundled Codex CLI after recovery: 0.154.0-alpha.6.2
    • Bundled Node after recovery: v24.20.0

    Reproduction timeline

    The old package was healthy at 09:52 local time. After the updater switched to 26.908.9136.0, two consecutive launches failed with the user-visible dialog:

    ChatGPT failed to start.
    Unable to locate the Codex CLI binary or required runtime components.
    Check the installation or explicit runtime overrides.
    
    1. First post-update launch (09:55:06)

      • 9 bundled_executable_relocation_failed events
      • 3 for codex.exe
      • 5 for node.exe
      • 1 for node_repl.exe
      • all reported errorCode=EPERM and operation=rename_staging
      • bootstrap failed at 09:55:34; app-server never spawned
    2. Second launch (09:56:05)

      • 8 relocation failures
      • 5 for codex.exe
      • 3 for node.exe
      • bootstrap failed again at 09:56:24; app-server never spawned
    3. Third launch (09:57:10)

      • 1 remaining codex.exe relocation failure
      • the finalized Codex directory appeared during the same second
      • app-server successfully spawned at 09:57:12
      • desktop startup then completed normally

    Sanitized destinations:

    %LOCALAPPDATA%\OpenAI\Codex\bin\12219cbfbcbddde7
    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\6f12e0ef1c6e5061
    

    Race/coordination evidence

    The finalized CUA runtime was created during the second failed launch, while the finalized Codex CLI directory was created during the third launch. On the successful third launch, one rename_staging attempt still returned EPERM, but the same final directory became available and the app-server spawned roughly one second later.

    This strongly suggests overlapping materialization attempts (within a launch and/or with cleanup from the preceding failed launch) are racing for the same content-addressed destination. One attempt can succeed while another receives EPERM; if no attempt wins before bootstrap gives up, the app reports the required components as missing. Repeated restarts gradually materialize the components and eventually allow startup.

    Current state

    After the third launch:

    • codex.exe, node.exe, and node_repl.exe all exist and have valid signatures;
    • config paths point to the finalized components;
    • the desktop main process is responsive;
    • no crash or hang event was recorded for this sequence.

    This is now reproducible after multiple independent desktop updates, not a one-off corrupt installation. A per-content-ID single-flight lock, coordination across overlapping app instances, and treating “destination now exists and validates” as success would prevent the post-update startup failure.

    No raw logs, account identifiers, session metadata, or private project paths are included.

  6. yaoshen2009-alt commented on Sep 20, 2026

    @yaoshen2009-alt

    Additional confirmation: this issue still reproduces on the current Windows desktop build.

    Environment

    • ChatGPT/Codex desktop package: 26.915.4065.0 (Microsoft Store/MSIX, x64)
    • Bundled Codex CLI: 0.155.0-alpha.9.2
    • Bundled Node after recovery: v24.21.0
    • Windows 10 Pro, build 19045, x64

    Observed behavior

    After updating the desktop app, the UI became persistently sluggish. In one 76-second startup session, the app logged 19 occurrences of:

    bundled_executable_relocation_failed
    errorCode=EPERM
    operation=rename_staging
    executableName=node.exe / node_repl.exe
    destinationPath=%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\df473e5367fa2b42
    

    The failures recurred roughly every 2–3 seconds. The final content-addressed runtime directory never appeared.

    This was followed by:

    • missing bundled node and node_repl runtime components;
    • bundled Chrome plugin reconciliation failure;
    • model refresh timeout;
    • workspace routing discovery failures;
    • remote-control enrollment failure;
    • shell environment loading taking approximately 14.6 seconds and timing out.

    The same failure pattern had occurred after the preceding desktop update, using a different content-addressed runtime directory. This indicates that the workaround does not persist across updates.

    Recovery

    I copied the cua_node payload bundled with the currently installed package into a separate staging directory, verified all 2,283 files and critical executables, and atomically renamed it to the expected destination:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\df473e5367fa2b42
    

    After recovery:

    • the finalized runtime contained 2,283 files / approximately 239 MB;
    • node.exe and node_repl.exe executed successfully;
    • no new staging directory appeared during a 10-second monitor;
    • the repeated relocation loop stopped;
    • Codex Doctor reported 20 checks OK and 0 failures;
    • the desktop UI became responsive again.

    This provides another reproduction on a newer build and supports the existing conclusion that a transient Windows rename conflict is amplified by unbounded full-runtime retries in the desktop main process.

    No raw logs, account identifiers, session data, or private project paths are included.

  7. binawoh commented on Oct 2, 2026

    @binawoh

    Captured what blocks the rename (Process Monitor), plus a minimal fix

    Adding the handle-level evidence that this thread, #45593 and #49611 were missing.

    Setup: Codex desktop (MSIX, x64) 26.928.1915.0 / 26.928.3736.0 / 26.930.2377.0, Windows 11 x64, Microsoft Defender plus a third-party real-time antivirus (file-system minifilter). The log shows coreGateEnabledAtStartup=false selectedRuntimeSource=bundled.

    Every update hits it. rename_staging / EPERM failures logged before cua_node\<hash> finally appeared: 34 (26.928.1915.0), 51 (26.928.3736.0), 30 (26.930.2377.0, spread over ~6 minutes of intermittent "Not Responding").

    What blocks the rename

    • Outside the app, with the bundled Node: copy resources\cua_node into a new folder and rename it immediately → EPERM 7/7. Keep the copy and retry ~100 ms later → succeeded 4/4.
    • The trigger is the .ps1 shims (e.g. under bin\node_modules\corepack\shims\). Copying one of them alone and renaming its folder fails intermittently (2/5); the same bytes saved as .txt never failed (0/5).
    • Process Monitor, 6 captures, 318 single-file samples: all 74 failed renames overlapped with the antivirus process opening/reading the just-copied .ps1 (it scans newly created script files); all 74 retries ~100 ms later succeeded. Defender also scanned these files, but every failure coincided with the third-party scan.
    • This is documented NTFS behavior: renaming a directory fails with STATUS_ACCESS_DENIED while any file in its subtree is open, even with FILE_SHARE_DELETE (MS-FSA 2.1.5.15.12). So any on-access scanner can cause it, and ProcMon "fixing" it in [Windows] Desktop startup repeatedly fails with EPERM during bundled executable rename_staging; succeeds after ProcMon changes timing #45593 fits: it shifts the timing.

    Why a ~100 ms collision becomes minutes of freezing: in nn() (application-network-startup-*.js, names from the 26.930.2377.0 bundle) the recursive copyFileSync, renameSync and cleanup rmSync all run synchronously on the main process. On rename failure the staging copy is deleted and the error rethrown without a retry; en() logs bundled_executable_relocation_failed and returns null, so the next caller copies all ~240 MB / ~2,370 files again and collides with the scanner again.

    Suggested fix

    1. Retry renameSync(staging, final) with a short backoff (start at 100 ms, give up after a few seconds). 100 ms was always enough here.
    2. If it still fails, keep the staging folder and retry only the rename later, instead of deleting and re-copying.
    3. Serialize attempts per hash, remember the failure for the session, and do the copy off the main thread.

    Workaround that works here: create cua_node\<hash> from outside the app (same content, retrying the rename) as soon as the new package lands, triggered by AppX deployment event 400 (Stage/Register) in Microsoft-Windows-AppXDeploymentServer/Operational. Codex then finds the folder valid and skips the copy.

  8. ASCII-768977 commented on Oct 23, 2026

    @ASCII-768977

    Still reproducible on Windows x64 with MSIX package 26.1016.8622.0 (desktop reports 26.1016.62342, build 21477). The app's updater reports up to date.

    After the update, the desktop repeatedly entered "Not Responding". Local investigation on 2026-10-23 found 206 bundled_executable_relocation_failed events across six launches that day (including the preceding 26.1016.6573.0 package), with operation=rename_staging and errorCode=EPERM. The latest launch alone logged 22 failures and browser_main main_thread_jank_snapshot events. Windows also recorded Application Hang event 1002.

    The runtime content directory changed from 2fbcd108736f9c20 to 2b841c3d44b123ec across those packages.

    A separate filesystem probe reproduced the timing sensitivity without invoking a plugin or touching the live runtime cache:

    • Recursively copy the packaged cua_node runtime into a fresh scratch directory using Node fs.copyFileSync.
    • The payload contained 2,384 files / 252,751,041 bytes; each copy took approximately 1.8–2.1 seconds.
    • Immediately call fs.renameSync on the completed directory: EPERM.
    • Wait 100 ms and retry only the rename, reusing the copied directory: success.
    • Three consecutive fresh-copy trials produced this same fail-then-pass result. An earlier independent trial also failed immediately and succeeded on a later retry.

    This is a filesystem reproduction on one machine, not a patched-client regression test. It does not identify which process or filter causes the transient denial. No antivirus settings were changed.

    Inspection of the installed runtime resolver still shows synchronous recursive copying followed by synchronous rename, cleanup on failure, and subsequent callers re-entering materialization. Please move this work off the desktop main thread and retry transient finalization failures with bounded asynchronous backoff while retaining the verified staged payload. A failure cooldown would prevent repeated full copies.

    Once the live runtime finalized, the UI recovered before any cleanup was performed. Its manifest, node.exe and node_repl.exe hashes match the packaged files. This is recovery, not a permanent fix for the next update.

    Only sanitized diagnostic facts are included; no raw logs, usernames, project paths or session identifiers are attached.

  9. ASCII-768977 commented on Oct 24, 2026

    @ASCII-768977

    Follow-up to my previous report: this happened again after the next update, and the external recovery script successfully restored the app.

    Still affected: Windows MSIX package 26.1021.3705.0. After updating, Codex again became unresponsive. Users should not have to manually repair the runtime after repeated app updates. Please prioritize a permanent fix.

    Local verification on October 25, 2026 (Australia/Sydney, UTC+11):

    • The two most recent failed launches each logged 17 bundled_executable_relocation_failed events: 34 failures total, with operation=rename_staging and errorCode=EPERM.
    • Both targeted cua_node content ID 1fb7137c46617d50.
    • Failure timestamps were 00:25:36–00:26:59 and 00:30:06–00:31:20 local time.
    • I closed Codex and ran the external recovery script. It detected the installed package, copied its Node runtime outside the desktop process, and finalized the runtime directory. It reported REPAIRED.
    • The runtime directory was created at approximately 00:32:02; Codex restarted at approximately 00:32:22.
    • The app became usable again. A subsequent read-only check confirmed that manifest.json, node.exe and node_repl.exe matched the installed package and that node_modules existed.
    • At the subsequent check, the restarted session had zero bundled-executable relocation failures and the window was responding. There was one main_thread_jank_snapshot, so this is not a claim of zero UI latency or long-term stability.

    The script copies the payload once and supports bounded retries of the final directory rename instead of repeatedly copying the whole runtime. Its output does not record how many rename retries were needed in this recovery, so I cannot claim that a retry was actually exercised this time. The earlier independent filesystem probe demonstrated immediate EPERM followed by success after a 100 ms delay.

    This is now a real post-update recovery using the workaround, not just a check-only validation. No application bundle, login settings, chats or projects were modified, and no antivirus settings were changed.

    Please fix runtime materialization in the desktop client: move synchronous copy/hash/cleanup work off the main thread, serialize requests per content ID, and use bounded asynchronous final-rename retries that retain the verified staged payload. Please confirm whether a fix is planned and identify the first Windows build containing it.

    Only sanitized facts are included; no raw logs or screenshots containing personal paths are attached.

  10. ASCII-768977 commented on Nov 3, 2026

    @ASCII-768977

    Another post-update recurrence, verified on November 3, 2026. Windows x64 MSIX package 26.1027.6604.0 is still affected. This follows my earlier report on 26.1021.3705.0 (#42484 (comment)).

    The user again reported severe post-update unresponsiveness and reran the external recovery script. Read-only inspection found:

    • Two failed launches logged 41 bundled_executable_relocation_failed events (29 + 12), all targeting cua_node content ID 989c7523a11c09b9, with errorCode=EPERM and operation=rename_staging.
    • Failure intervals (UTC): 2026-11-03 05:43:21.927–05:45:36.898 and 05:46:07.402–05:47:10.201.
    • The finalized runtime directory had a modification timestamp of approximately 05:47:49 UTC; the subsequent desktop session started at 05:47:53 UTC.
    • Through 05:52:22 UTC, that restarted session's inspected logs contained zero bundled-executable relocation failures. A main-thread jank snapshot was still present, so this is not a claim of zero remaining UI lag or long-term stability.
    • SHA-256 hashes of the finalized manifest.json, bin/node.exe and bin/node_repl.exe all match the installed package; bin/node_modules exists. The manifest identifies Node 24.22.1-cua.1.

    The script's console output was not captured in this inspection, so I cannot independently quote its result or claim a particular rename-retry count. The finalized files and subsequent logs are consistent with recovery after the user reran it. No new repair or settings changes were performed during this check.

    This workaround must be repeated after updates; it is not a permanent resolution. Please prioritize a client fix and provide the first Windows build containing it: move expensive materialization off the main thread, serialize per-content-ID installation, and retain the staged payload while performing bounded asynchronous retries of final rename, with failure cooldown instead of repeated full copying.

    Only sanitized facts are posted: no raw logs, personal paths, account/session identifiers, project data or screenshots.

  11. Yunxiang8 commented on Nov 4, 2026

    @Yunxiang8

    Additional reproduction after the Windows Codex desktop update on 2026-11-04.

    The bundled cua_node runtime repeatedly creates .staging-* directories, but the expected finalized runtime directory never appears. Desktop logs show bundled_executable_relocation_failed with errorCode=EPERM and operation=rename_staging. I counted 497 such failures. After copies accumulated, the logs also recorded 73 ENOSPC copy failures.

    At one point, 399 staging directories had accumulated. Removing older staging directories recovered space, but new copies continued to appear; a later check found 52 directories using 6.31 GiB.

    Environment: Codex desktop package 26.1029.7803.0, Windows build 26300.9711, affected runtime content ID 9c26d707817e90a7. Please limit retries, reuse an existing staged copy when retrying the rename, and clean up failed staging directories.

  12. bherreraicon commented on Nov 4, 2026

    @bherreraicon

    Español

    Puedo confirmar este problema en más de una máquina Windows y a través de varias actualizaciones recientes de Codex Desktop.

    Patrón observado repetidamente:

    • Después de actualizar Codex Desktop, aparece un nuevo hash de runtime bajo %LOCALAPPDATA%\OpenAI\Codex\bin.
    • En vez de crearse la carpeta final <hash>, Codex crea múltiples carpetas .staging-<hash>-XXXXXX.
    • La carpeta final no existe, aunque cada staging contiene un codex.exe válido y ejecutable.
    • La aplicación puede terminar mostrando errores secundarios como “Organization settings could not be loaded” o no localizar correctamente el CLI/runtime.
    • Reiniciar, cerrar sesión o volver a abrir la aplicación no corrige el problema.
    • Con Codex completamente cerrado, renombrar manualmente una de las carpetas .staging-<hash>-XXXXXX a <hash> funciona inmediatamente.
    • El codex.exe resultante ejecuta --version correctamente y Codex Desktop vuelve a iniciar.
    • Una vez reparado, pueden eliminarse los staging huérfanos sin afectar la instalación.

    Casos recientes que hemos reproducido:

    • Desktop 26.1027.6604.0 → hash b6c7fc9497179c98
    • Desktop 26.1029.7803.0 → hash a159911ff70742e9
    • CLI del caso más reciente: 0.166.0-alpha.6

    El mismo patrón se reprodujo también en una segunda máquina independiente.

    Workaround verificado:

    $base = "$env:LOCALAPPDATA\OpenAI\Codex\bin"
    
    $staging = Get-ChildItem $base -Directory |
        Where-Object Name -like ".staging-<HASH>-*" |
        Select-Object -First 1
    
    & "$($staging.FullName)\codex.exe" --version
    
    Rename-Item -Path $staging.FullName -NewName "<HASH>"
    
    & "$base\<HASH>\codex.exe" --version

    Después de esto, Codex vuelve a funcionar normalmente.

    Esto parece indicar que el contenido del staging ya es correcto y que el fallo está específicamente en la promoción/rename final del staging al directorio content-addressed. Sería muy útil que Codex tratara este fallo como recuperable: reintento acotado del rename, coordinación de una sola materialización por hash y limpieza posterior de staging huérfanos.


    English

    I can confirm this issue on more than one Windows machine and across several recent Codex Desktop updates.

    Repeatedly observed pattern:

    • After a Codex Desktop update, a new runtime hash appears under %LOCALAPPDATA%\OpenAI\Codex\bin.
    • Instead of creating the final <hash> directory, Codex creates multiple .staging-<hash>-XXXXXX directories.
    • The final directory is missing, even though each staging directory contains a valid, runnable codex.exe.
    • The app may then surface secondary errors such as “Organization settings could not be loaded” or fail to locate the CLI/runtime.
    • Restarting Windows, signing out, or reopening the app does not fix it.
    • With Codex fully stopped, manually renaming one .staging-<hash>-XXXXXX directory to <hash> succeeds immediately.
    • The resulting codex.exe runs --version successfully and Codex Desktop starts working again.
    • After recovery, orphaned staging directories can be deleted without affecting the working installation.

    Recent reproduced cases:

    • Desktop 26.1027.6604.0 → hash b6c7fc9497179c98
    • Desktop 26.1029.7803.0 → hash a159911ff70742e9
    • Latest reproduced CLI: 0.166.0-alpha.6

    The same pattern was also reproduced on a second independent Windows machine.

    Verified workaround:

    $base = "$env:LOCALAPPDATA\OpenAI\Codex\bin"
    
    $staging = Get-ChildItem $base -Directory |
        Where-Object Name -like ".staging-<HASH>-*" |
        Select-Object -First 1
    
    & "$($staging.FullName)\codex.exe" --version
    
    Rename-Item -Path $staging.FullName -NewName "<HASH>"
    
    & "$base\<HASH>\codex.exe" --version

    After this, Codex works normally again.

    This strongly suggests that the staged payload is already valid and that the failure is specifically in the final promotion/rename from staging to the content-addressed runtime directory. It would help if Codex treated this as recoverable: bounded retry/backoff around the rename itself, single-flight coordination per content hash, and cleanup of orphaned staging directories on the next successful launch.

  13. bherreraicon commented on Nov 4, 2026

    @bherreraicon

    🔧 Small human-readable summary / Resumen con un poco de humor

    🇪🇸 Versión corta: cada actualización nos está regalando una nueva colección de carpetas .staging-* 😅. El contenido está bien, el codex.exe funciona, pero la “mudanza” al directorio final no termina. Cerramos Codex, hacemos el rename manual y… 🧟‍♂️ Codex vuelve a la vida.

    🇺🇸 Short version: every update seems to gift us a fresh collection of .staging-* folders 😅. The payload is fine and codex.exe runs, but the final move to the content-addressed directory does not complete. Stop Codex, rename one staging folder manually and… 🧟‍♂️ Codex comes back to life.

    🧩 What makes this especially useful diagnostically:

    • same failure pattern across multiple Windows machines;
    • same successful manual recovery;
    • recurring after subsequent updates with a new hash;
    • no need to modify WindowsApps permissions;
    • no need for a permanent CODEX_CLI_PATH workaround when the final hash directory is created correctly.

    🙏 If maintainers can reproduce the final rename failure, a supported repair/retry path here would save users from having to perform the “staging resurrection ritual” after updates.

  14. bherreraicon commented on Nov 9, 2026

    @bherreraicon

    🟢 Update: this time Windows sign-out was enough / Actualización: esta vez bastó cerrar sesión de Windows

    🇪🇸 Nueva observación, reproducida en dos máquinas al mismo tiempo:

    • Ambas máquinas se actualizaron a la misma build reciente de Codex Desktop.
    • Ambas mostraron inicialmente el mismo error que veníamos viendo tras actualizar.
    • En incidentes anteriores, cerrar sesión de Windows e incluso reiniciar la máquina NO resolvía el problema; terminábamos reparando manualmente la carpeta .staging-* y haciendo el rename al hash final.
    • Esta vez hicimos solamente cerrar sesión de Windows y volver a entrar.
    • En ambas máquinas, Codex arrancó correctamente después, sin rename manual, sin tocar CODEX_CLI_PATH y sin reconstruir el runtime.

    🧩 Esto parece importante porque sugiere que algo cambió para bien: quizá la build actual vuelve a intentar correctamente la promoción del runtime cuando desaparecen los handles/procesos de la sesión anterior.

    😄 En otras palabras: por primera vez en varias actualizaciones, no tuvimos que realizar el ritual de resurrección de .staging-*.

    Sería interesante confirmar si esto es resultado de una mejora deliberada en la lógica de retry/recovery. Si es así, va en la dirección correcta. 👍


    🇺🇸 New observation, reproduced on two machines at the same time:

    • Both Windows machines were updated to the same recent Codex Desktop build.
    • Both initially showed the same post-update failure pattern we had been seeing.
    • In previous incidents, signing out of Windows and even rebooting the machine did NOT fix it; we still had to manually promote a .staging-* directory to the final hash directory.
    • This time, we only signed out of Windows and signed back in.
    • On both machines, Codex started normally afterward, without any manual rename, without changing CODEX_CLI_PATH, and without rebuilding the runtime.

    🧩 This seems significant: it may indicate that the current build now retries or completes runtime promotion correctly once stale handles/processes from the previous Windows session are gone.

    😄 For the first time in several updates, the .staging-* resurrection ritual was not needed.

    If this behavior is the result of a recent recovery/retry improvement, it is definitely a step in the right direction. 👍

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

    appbugperformancewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions