[Windows] Primary runtime updater re-downloads 501.8 MB hourly after non-retryable EPERM activation failure

Open 💬 5 comments Opened Aug 23, 2026 by jan013013
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using?

  • Current Windows Store package: OpenAI.Codex 26.818.5229.0 (x64)
  • The repeated failures were logged by package build 26.814.5167.0
  • Codex CLI: 0.147.0
  • Primary runtime bundle requested: 26.819.11345

What platform is your computer?

Windows 11 Pro x64, version 10.0.26200 (build 26200).

What issue are you seeing?

The Codex desktop primary-runtime updater downloaded the same 501,849,919-byte archive from persistent.oaistatic.com approximately once per hour after every activation failure.

The download URL was:

https://persistent.oaistatic.com/codex-primary-runtime/26.819.11345/codex-primary-runtime-win32-x64-26.819.11345.tar.gz

Local log analysis found:

  • First attempt: 2026-08-19 08:37:52 local time
  • Successful completion: 2026-08-23 11:48:03 local time
  • 101 scheduled attempts in roughly 4 days
  • 96 complete archive downloads followed by activation failure
  • 4 network-stage failures
  • 1 eventual success
  • At least 48.678 GB of confirmed traffic from complete archive downloads alone

The repeated error was:

[primary-runtime-installer] primary_runtime_bundle_install_outcome
errorCategory=permission_denied
errorCode=EPERM
failureStage=activate_runtime
outcome=failed
retryable=false
trigger=scheduled_update
errorMessage="EPERM: operation not permitted, rename '%USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime' -> '...previous-<uuid>'"

The current runtime directory contained executables being used by Codex. Windows therefore refused the directory rename. That part is expected Windows file-lock behavior. The bandwidth-consumption problem is that Codex deleted the staging directory (including the fully downloaded, verified archive) after the non-retryable activation failure, then the hourly scheduler downloaded the identical 501.8 MB archive again.

This happened silently, with no user notification or visible bandwidth warning.

What steps can reproduce the bug?

  1. Run Codex Desktop on Windows with the current primary runtime actively in use.
  2. Make a newer primary runtime bundle available to the hourly scheduled updater.
  3. Allow the 501.8 MB bundle to download.
  4. Let activation attempt to rename the active codex-primary-runtime directory.
  5. Observe EPERM at failureStage=activate_runtime.
  6. Leave Codex running.
  7. Observe another full download on the next hourly scheduled check, despite retryable=false.

What is the expected behavior?

After a complete bundle download and a non-retryable activation failure, Codex should not discard the verified archive and download it again every hour.

Any of the following would prevent the traffic loop:

  • retain the verified archive and activate it after Codex exits/restarts;
  • defer activation when the current runtime has live processes;
  • stop automatic retries after a non-retryable error;
  • use exponential backoff and a retry/traffic cap;
  • notify the user and offer “restart to finish update”;
  • respect metered-network settings.

At minimum, one failed 500 MB update must not become an unbounded hourly re-download loop.

Additional information

No raw log files are attached because they can contain local paths and session details. The counts above were derived from the local Codex desktop logs and the archive size was verified from the HTTP response.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 5 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #38999

Powered by Codex Action

jan013013 · 5 days ago

I reviewed #38999. It is related to primary-runtime installation on Windows, but the failure mode and impact here are distinct: the runtime was present, each verified 501.8 MB payload was discarded after a retryable=false activation failure, and the scheduler downloaded it again hourly, producing at least 48.678 GB of traffic. This report is specifically about the unbounded re-download loop and missing backoff/cache/restart handling.

zemeng5208 · 5 days ago

This is a good match for one narrow Windows-local failure mode I’ve been tracking. I maintain WinBridge Recovery: https://github.com/zemeng5208/winbridge-recovery

For this issue, the part WinBridge may help with is diagnosing the local activation blocker, not the updater’s hourly retry policy itself. In particular, an EPERM on

rename %USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime -> ...previous-<uuid>

is consistent with Windows still having one or more executables/DLLs under the active runtime tree mapped by a live or stale Codex/helper process. WinBridge’s local diagnostics are intended to identify this class of file-lock / runtime-helper ownership problem and distinguish it from cache/version/staging drift before attempting recovery.

A useful separation here is:

  • Local layer WinBridge can help diagnose/recover: stale helper/runtime processes holding the current runtime directory, inconsistent user-side runtime staging/version state, or a partially activated local runtime after a failed rename.
  • Upstream behavior WinBridge cannot fix: Codex deleting a verified ~501.8 MB staged bundle after retryable=false, scheduling another full download every hour, or failing to defer activation until the owning processes exit. That retry/cache policy needs an OpenAI-side fix.

I would also avoid deleting the active runtime directory manually while Codex is running; on Windows that can turn a clean lock failure into a partially staged state. WinBridge does not modify WindowsApps, and I would not expect it to guarantee a fix if the only problem is the updater lifecycle/backoff logic.

The fact that your final attempt eventually succeeded is also useful evidence: it makes a persistent package-corruption explanation less likely and is consistent with the blocking handle eventually disappearing.

scroner888-ux · 3 days ago

This looks like the same underlying issue as #40455 (which I opened independently, before finding this one). My report approaches it from a different angle — network-level packet capture rather than internal error logs — but points to the exact same subsystem and even the same bundle version (26.819.11345).

Adding a few things that might help narrow this down further:

  1. Confirmed to also trigger on cold launch, not just the hourly background scheduler — I never left the app running for an hour; the ~400MB burst happens within the first 15 seconds of every fresh start (measured via pktmon, deduplicated by PktGroupId+PktNumber to rule out double-counting across NDIS capture points).
  2. DNS correlation: persistent.oaistatic.com resolves to two A records (104.18.32.47, 172.64.155.209); together they accounted for 98.9% of all captured traffic in a 63-second launch window.
  3. Reproduced across two consecutive Store updates (26.818.3698.0 → 26.818.8289.0) — so this isn't specific to one build. If the EPERM/rename-on-active-runtime root cause you found is accurate, that would explain why updating the app version alone doesn't fix it: the lock condition (runtime files in use by the running process) would still apply on the new build too.

Given this, this bug seems to affect anyone who either keeps the app open long-term (hourly loop, as you found) or restarts it frequently (per-launch loop, as I found) — same root cause, different observed cadence. Closing my duplicate (#40455) and linking here.

wakare · 10 hours ago

Independent confirmation on Windows 11 x64. I am not attaching raw logs because they may contain local paths and session details.

Environment

  • Codex Windows package: OpenAI.Codex_26.818.2441.0_x64__2p2nqsd0c76g0
  • Previously installed primary runtime: 26.813.12317
  • Runtime update target: 26.826.12353

Network observations

A local per-process/per-destination traffic collector observed:

  • about 3.79 GiB attributed to the Codex desktop executable over an approximately 8-hour capture window;
  • about 3.75 GiB of that traffic downloaded from persistent.oaistatic.com;
  • near-hourly bursts of approximately 503,300,000 bytes (~480 MiB) each;
  • at least 25 failed scheduled update attempts in approximately 24 hours in the desktop logs.

The requested archive was:

https://persistent.oaistatic.com/codex-primary-runtime/26.826.12353/codex-primary-runtime-win32-x64-26.826.12353.tar.gz

Sanitized failure signature

trigger=scheduled_update
bundleVersion=26.826.12353
errorCategory=permission_denied
errorCode=EPERM
failureStage=activate_runtime
outcome=failed
retryable=false
errorMessage="EPERM: operation not permitted, rename
'C:\Users\<redacted>\.cache\codex-runtimes\codex-primary-runtime'
-> '...codex-primary-runtime.previous-<redacted>'"

Process inspection showed a long-lived bundled pwsh.exe running from inside:

C:\Users\<redacted>\.cache\codex-runtimes\codex-primary-runtime\dependencies\native\powershell\pwsh.exe

It was a child of the Codex process. Because the executable being used is inside the directory that activation tries to rename, this is consistent with Windows denying the rename while the old runtime is still mapped by a live helper process.

This independently reproduces the same updater loop with a newer runtime target (26.826.12353). The important upstream issue is still the same: after a completed download and a retryable=false activation failure, the verified archive is not reused and the full payload is downloaded again on the next scheduled attempt. The updater should coordinate helper shutdown, defer activation until restart, retain the verified archive, and/or stop retrying the full download.