Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.917.9434.0
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
This may share the same overall first-launch runtime-materialization path as #45179 and #46338, but this report isolates a more specific implementation-level performance defect in the current successful UNKNOWN/-4094 fallback path.
Older reports such as #34764 / #42501 describe copyfile UNKNOWN / errno -4094 causing runtime relocation to fail. On 26.917.9434.0, relocation eventually succeeds because the app now falls back to synchronous byte-stream copying - but on this machine that fallback itself causes a severe performance regression.
Observed startup behavior
First launch after the update:
- host startup critical path: ~225.98 s
cua_nodematerialization occupies roughly ~212 s- the main window is only revealed after materialization is effectively complete
A startup log line shows:
Failed to load shell env ... timeoutMs=5000 durationMs=219869 status=timed_out
Second launch of the same version:
- host startup critical path: ~4.63 s
- window ready-to-show in <1 s
- the same shell-env timeout completes in ~5.08 s
This suggests PowerShell is not taking ~220 s. The Electron main event loop appears to be blocked during first-launch runtime relocation, so the 5 s timer itself cannot run on time.
Experiment 1: identify what is created during the slow launch
For the cua_node runtime:
- 2,283 files
- ~239 MB
- source: packaged
app\resources\cua_node - destination:
%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>
Across the full first-launch relocation window, about 2,288 files / ~640.3 MB are created under %LOCALAPPDATA%\OpenAI\Codex. The timestamps line up closely with the period in which the UI is unavailable.
Experiment 2: rule out raw source-read performance
Reading the complete 2,283-file tree without writing:
WindowsApps source tree:
2,283 files / 239 MB
1.119 s
~213.5 MB/s
Already-materialized local tree:
2,283 files / 239 MB
0.543 s
~440.2 MB/s
Raw packaged-runtime reads are therefore fast enough that source-read throughput does not explain a multi-minute stall.
Experiment 3: controlled normal tree copy
Using a straightforward byte-stream tree copy outside the ChatGPT code path:
WindowsApps source -> temp:
13.201 s
172.9 files/s
~18.1 MB/s
Local materialized source -> temp:
12.717 s
179.5 files/s
~18.8 MB/s
The results are very close, so the secondary AppX volume / cross-volume layout alone does not explain the delay.
Experiment 4: inspect the current relocation implementation
The packaged app.asar relocation helper effectively does this per file:
try {
fs.copyFileSync(src, dst)
} catch (e) {
// handles errno 6000 or UNKNOWN/-4094
fs.writeFileSync(dst, fs.readFileSync(src))
}The surrounding traversal/validation path also uses synchronous filesystem APIs such as readdirSync, copyFileSync, readFileSync, writeFileSync, mkdirSync, and renameSync.
Experiment 5: reproduce the current fallback strategy
I reproduced the same strategy in a minimal Node.js test:
- recursively enumerate the packaged
cua_nodetree; - call
fs.copyFileSync(src, dst)for every file; - on
UNKNOWN/-4094, fall back tofs.readFileSync(src)+fs.writeFileSync(dst); - count direct-copy successes and fallback hits;
- delete the temporary output after the benchmark.
Result:
files: 2283
size: 239 MB
elapsed: 127.98 s
files/sec: 17.8
throughput: ~1.9 MB/s
copyFileSync direct success: 0
fallback path: 2283
other errors: 0
Every one of the 2,283 files first failed with:
code = UNKNOWN
errno = -4094
syscall = copyfile
before taking the synchronous fallback.
Key comparison:
normal byte-stream copy: ~13.2 s
current fallback strategy: ~128.0 s
actual first launch: ~226.0 s
So reproducing the current fallback strategy is already about 10x slower than a straightforward copy on the same machine, before accounting for the rest of Electron startup work.
Interpretation
The current fallback appears to solve the older functional failure (runtime relocation eventually succeeds), but it can convert that failure into a multi-minute startup stall:
new runtime hash missing
-> relocation starts
-> copyFileSync fails for every packaged file with UNKNOWN/-4094
-> every file pays exception + fallback cost
-> synchronous readFileSync/writeFileSync for thousands of files
-> Electron main process is blocked
-> timers/window startup are delayed
-> relocation finishes
-> subsequent launches are fast because the runtime hash now exists
What steps can reproduce the bug?
- Install/update Codex App from Microsoft Store/MSIX to a build whose runtime hash has not yet been materialized locally.
- Launch the app for the first time after the update.
- Observe that the usable window is delayed for minutes while files are created under
%LOCALAPPDATA%\OpenAI\Codex\runtimesandbin. - Close the app after it becomes usable.
- Launch the same version again; startup returns to a few seconds.
- To reproduce the implementation-level slowdown independently, run the same per-file strategy against the packaged
cua_nodetree: tryfs.copyFileSync, catchUNKNOWN/-4094, then usefs.readFileSync+fs.writeFileSync. On this machine all 2,283 files hit the fallback and the test takes ~127.98 s, versus ~13.2 s for a straightforward byte-stream copy of the same tree.
What is the expected behavior?
Runtime materialization after an update should not block the Electron main thread for minutes. If packaged files consistently require an alternate copy path, the app should avoid thousands of predictable failed copyFileSync attempts and perform the relocation without delaying window creation, IPC, and timers. A first launch should remain responsive and complete in roughly the same order of magnitude as a normal copy of the bundled runtime.
Additional information
Related reports: #45179, #46338, #34764, #42501.
This issue intentionally focuses on the performance regression in the fallback that now succeeds, rather than the older hard relocation failure.
Potential implementation directions suggested by the measurements:
- detect the
UNKNOWN/-4094source condition once and switch the whole tree to the alternate copy path instead of throwing/catching per file; - use a Windows-native copy path with the appropriate packaged/protected-file semantics instead of generic Node
copyFileSyncfollowed by fallback; - move runtime materialization to a worker/child process so it cannot block the Electron main event loop;
- where possible, materialize during update/install staging rather than on the first user-visible launch.
Windows Defender real-time protection was disabled during these measurements, which makes Defender an unlikely explanation for the measured ~10x difference between the two copy strategies.
I can provide exact startup-log excerpts and the minimal Node.js reproduction script if useful.
Activity
github-actions commentedon Sep 24, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Just1dream commentedon Sep 24, 2026
Thanks for the duplicate suggestion. #46459 appears to describe the same user-visible first-launch symptom. This issue is intended to isolate a specific implementation-level cause in the current successful
UNKNOWN/-4094fallback path, including a controlled reproduction showing ~13.2 s for a normal byte-stream copy versus ~128 s using the current fallback strategy.I am leaving this open for now in case maintainers prefer to track that fallback performance regression separately.
2390471470-pixel commentedon Oct 5, 2026
Posting an additional reproduction and sanitized diagnostic logs at the affected user's request. This confirms the repeated
UNKNOWN/-4094per-file fallback described here and shows a blocking organization-settings dialog in a newer build with a separate 120-second preparation deadline. Related policy-budget report: #48729; the currentphase=preparationfailure should be distinguished from the olderphase=policy-readfailures.Additional reproduction on Windows MSIX 26.930.4958.0
Summary
After each observed Codex update, the first launch displays “Organization settings could not be loaded.” Selecting Retry allows startup to complete. For the current version, local runtime preparation exceeds its hardcoded 120-second limit before organization-policy reading begins. The dialog's network/proxy/firewall explanation therefore obscures a local preparation failure. No signed application files, security settings, or account configuration were changed during diagnosis.
Environment
OpenAI.Codex26.930.4958.0, x64; package status normal.C:\Program Files\WindowsApps\<package>. The registered package directory is a junction toD:\WindowsApps\<package>; both routes refer to the same installed package.%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>and%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>.Reproduction and behavior
Expected: first-launch runtime preparation completes without a misleading organization-settings error. A local preparation delay should be handled separately from policy/network failures.
Actual current-version log:
After Retry,
configRequirements/readsucceeds (errorCode=null), as does account querying.Current-version evidence
Independent file timestamps show the new
cua_nodecache being populated over 231.732 seconds. It contains 2,367 files, 251,349,224 bytes, and 336 directories. Codex executable caching preceded it; ripgrep caching followed it.Read-only inspection of the installed bundle shows:
initializeNodeNetworkPermissionsfirst awaits runtime preparation, then enterspolicy-read.120000milliseconds and checks elapsed time after the Promise resolves. Synchronous copying can block the timer callback and still trigger the elapsed-time check afterward.cua_nodetree, includingnode_modules.preparation. The copy has already completed, so the next iteration can proceed immediately; Retry itself does not reload/relaunch the application.Copy-path reproduction
Installed source files have the
Encryptedattribute. The bundled copy routine triescopyFileSync, then falls back toreadFileSync/writeFileSyncfor errno6000, orUNKNOWN/errno-4094.In same-process comparisons using 60 representative files, each at most 1 MiB, all 60 native-copy attempts failed with
UNKNOWN/-4094. Fresh destinations were on D:Both methods produced matching SHA256 hashes for every sample.
A complete D-only scratch copy using direct read/write took 2,736 ms. Subsequent per-file SHA256 verification took 1,582 ms: 2,367/2,367 matches, zero failures, and all 336 directories present.
The original launch and later full-copy benchmark had different cache temperatures and execution contexts. These timings establish a viable copy method, not a guaranteed future speed multiplier.
UNKNOWN/-4094alone also does not identify a unique underlying Windows error.Historical scope and requested investigation
Across 21 retained initial-launch logs from September 30–October 5, the first observed launch of each of six versions logged a startup-policy timeout; 15 later launches of those same versions did not. Versions 26.928.2636.0, 26.928.3736.0, 26.928.4866.0, and 26.930.2377.0 reported
policy-read; 26.930.3930.0 and 26.930.4958.0 reportedpreparation. Current-version code does not prove that every earlier timeout had the same cause.Please investigate repeated failing native copies of encrypted MSIX runtime files, synchronous preparation within this startup deadline, and the shared recovery message. No persistent repair has been applied. Separately prewarming verified caches could mitigate the issue, but automatic updater relaunch may bypass such a helper. Sanitized logs accompany this report.
Sanitized startup logs, deployment/runtime timing evidence, and raw copy-test result data
zzzzzhi421-art commentedon Oct 8, 2026
Additional reproduction on Windows x64, OpenAI.Codex MSIX 26.1002.7124.0, submitted at the affected user's request. The per-file native-copy failure remains reproducible in this newer build and leads to the misleading "Organization settings could not be loaded" startup dialog.
Current symptom and failure stage
The user reports long first launches after application updates and after restarting the PC; selecting Retry usually allows the app to open. The strongest evidence collected in this investigation concerns the latest post-update launch. Same-version every-boot reproduction has not been established separately.
The retained startup log records:
The configuration is already
windows.sandbox = "unelevated", so changing to that mode did not prevent recurrence. The installed implementation performs runtime preparation beforepolicy-read, with a separate 120-second preparation budget and an elapsed-time check after the preparation promise resolves. The expensive recursive copy remains synchronous. This is related to #48729, but the observed failure here is explicitlyphase=preparation.The current launch's cache-directory and last-file timestamps span approximately 12 minutes 6 seconds, before the app-server starts. These are filesystem timing observations, not an instrumented function profile; the entire process-to-preload duration is not being attributed to copying because it may include time spent in the recovery dialog.
Full-tree copy experiments
Using the application's bundled Node v24.21.0, the installed
cua_nodetree contains 2365 files / 251,216,888 bytes. All tests wrote fresh isolated diagnostic directories, without clearing or modifying the live cache.copyFileSyncfor every file, then existing read/write fallbackDestination verification was additional, taking approximately 1-5 seconds. These are warm-cache diagnostic measurements with destinations on D:, not cold application-startup timings. The candidate run overlapped the tail of the original-strategy run; these figures should not be treated as a promised production speed multiplier.
Every native failure in the full-tree original-strategy test was
code="UNKNOWN", errno=-4094. An independent 12-file Win32CopyFileWprobe failed for all 12 packaged source files with error 6000, whose local error text is "无法加密指定的文件。" (The specified file could not be encrypted.) The sourcenode.exehas the Encrypted attribute. The equivalent 12-file copy probe from the already-materialized cache succeeded. This establishes the observed native-copy error for this machine; it does not imply that everyUNKNOWN/-4094error everywhere has this cause.Separately, all 2365 files in the actual live runtime cache match the installed source by SHA-256. The runtime content identity calculated using the client's three-file algorithm matches the selected cache directory. Re-clearing this healthy cache would simply force materialization again.
Requested fix
Please investigate a fix in the packaged client that:
The candidate copy behavior was tested only in isolated diagnostic copies. No patched application was installed and no cold-boot/post-update acceptance of a patched client is claimed. No application-package files or security settings were changed during these experiments. The measurements do not identify antivirus software as the cause.
Only sanitized technical details are included here: no credentials, private filesystem paths, full configuration, full logs, or conversation transcripts.
analistadev1 commentedon Oct 17, 2026
Runtime relocation copy failures exceed preparation timeout and show misleading organization-settings error (Windows desktop 26.1013.4894.0)
Environment
26.1013.4894.00.163.0-alpha.10.224.21.0Program Files\WindowsAppsalias and actual D:WindowsAppslocation resolved to the same files, with matching manifest hashes.Report context
This report is an update for the existing Windows startup issue #47770, which is closely related to issue #41822.
Actual behavior
On startup, Codex took roughly 160 seconds from process start at 12:39:01 until showing the warning “Organization settings could not be loaded.” The new runtime cache materialized between 12:39:12 and 12:41:40, about 128 seconds, exceeding the configured preparation timeout of 120,000 ms. The timeout is tagged
phase=preparationand occurs before the policy-read/RPC step.After the cache had been prepared, restarting Codex was quick and the warning did not appear. The warning therefore coincided with slow first-time runtime preparation; this observation does not establish that the organization settings request itself caused the delay.
Runtime paths
D:\WindowsApps\OpenAI.Codex_26.1013.4894.0_x64__2p2nqsd0c76g0\app\resources\cua_nodeC:\Program Files\WindowsApps\OpenAI.Codex_26.1013.4894.0_x64__2p2nqsd0c76g0\app\resources\cua_node; resolves to the D: package files%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<content-hash><runtime-cache>\bin\node.exeC:\Program Files\nodejs\node.exe; not implicated by the observed process timelineThe application-private Node.js runtime is a separate executable from the global Node.js installation. The desktop package and runtime cache are on different volumes.
Expected behavior
First-time runtime preparation should finish promptly and Codex should not show an organization-settings warning as a misleading result of preparation taking too long. Subsequent starts should remain quick.
Reproduction and measurements
The slowdown was reproduced in an isolated temporary directory by copying only the packaged
cua_noderuntime tree. The reproduction used synchronous file copy, falling back to buffered read/write whencopyFileSyncfailed:copyFileSync. When it fails withUNKNOWN/ errno-4094, read the source file and write its contents to the destination.Results for the same tree (2,369 files, 252,264,432 bytes, 337 directories):
copyFileSyncfailed for all 2,369 files withUNKNOWN/ errno-4094.copyFileSync-then-buffered-fallback strategy completed without errors in 138.452 seconds.The isolated reproduction retained no script. These steps describe the method and observed results rather than a complete standalone repro program.
Diagnostics
Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false.manifest.json,bin/node.exe, andbin/node_repl.exematched between the installed source and runtime cache.Suggested investigation
The measured bottleneck is the repeated failed
copyFileSyncattempts before buffered fallback: the full strategy was roughly 38.5 times slower than copying the same tree directly. The strategy added about 57 ms per file compared with the direct buffered copy. Please investigate why the packaged runtime'scopyFileSyncoperations fail on this Windows setup. One possible area to examine is whether fallback handling can avoid repeated overhead for files in an affected encrypted subtree, while preserving the existing policy checks. This is a diagnostic lead, not a prescribed fix.The Windows-level root cause remains unisolated. The copy failure and fallback cost are reproducible, but the evidence does not identify which Windows restriction or behavior triggers the copy errors. EFS, Store installation location, and any one factor have not been established as the sole cause. The global Node.js installation is a separate executable and is not implicated by the observed process timeline.
S4kuzy0 commentedon Oct 19, 2026
Additional local reproduction: protected-file copy failures and verified alternatives; please fix first startup after updates
Submitted at the affected user's explicit request. This is a sanitized technical summary of an isolated test collected on 2026-10-19 (Beijing time), alongside read-only inspection of the installed desktop implementation.
Environment and scope
OpenAI.Codex 26.1013.4894.0.26.1013.40934, build20770, production channel.v24.21.0; libuv:1.52.1.<installed-package>/app/resources/cua_node/manifest.json, with the Encrypted attribute.Observed copy results for the same source file
CopyFileWERROR_ENCRYPTION_FAILED (6000)CopyFileExWwithoutCOPY_FILE_ALLOW_DECRYPTED_DESTINATIONERROR_ENCRYPTION_FAILED (6000)CopyFileExWwithCOPY_FILE_ALLOW_DECRYPTED_DESTINATIONfs.copyFileSynccode="UNKNOWN",errno=-4094,syscall="copyfile"The native-copy tests used fail-if-destination-exists semantics. The source SHA-256 was identical before and after the tests.
This verifies two working alternatives for this particular source on this machine. It is a one-file diagnostic, not a new whole-tree performance benchmark, a repaired desktop cold-start test, or proof that every
UNKNOWN/-4094error is encryption-related.Installed implementation findings
Read-only inspection of the current packaged JavaScript shows:
copyFileSyncseparately for every file, then falls back to synchronous content read/write after the recognized error. The same failing native-copy path is therefore retried throughout an affected tree.windows-file-copy-B2PsciEv.jscheckserrno === 6000for its asynchronous encrypted-copy fallback. The observed Node error haserrno === -4094, so it does not match that check. This related error-mapping defect is also tracked in [Windows] Code Review unavailable: bundled-plugin copy fails and encryption fallback checks the wrong errno #51218.Requested product fix and acceptance criteria
Please make the desktop app itself handle this during the first launch after an update changes the runtime content/cache identity, including the updater's own automatic relaunch. The user needs normal startup without a separate launcher, extra shortcut, manual prewarming, or an external background repair job.
Potential implementation directions supported by the sample are an appropriate Windows native copy flag or a content-stream copy path. Preserve staging, integrity validation, atomic publication, unrelated-error propagation, package trust, and organization/network policy enforcement. Avoid treating arbitrary
UNKNOWNerrors as encryption failures.Please validate both a missing/new runtime cache after an update and subsequent cached launches. Moving materialization off the Electron main thread and distinguishing local preparation failures from organization-policy/network failures would also address the observed failure mode. If supported in-package execution can eliminate relocation, that is another product-level option to evaluate; it has not been validated here.
No installed application files, local configuration, ACLs, security policies, shortcuts, services, or scheduled tasks were changed for this investigation. No raw logs, account information, credentials, user-profile paths, machine identifiers, session transcripts, or proprietary source code are included.
Addendum: App-contained core registration happens after initial preparation
Evidence level: read-only analysis of the installed source and existing startup logs. This has not been execution-tested with the core gate enabled, with a missing cache, or through a real update/relaunch. No local configuration or launch entry was changed.
In the inspected
26.1013.4894.0package, the startup sequence is:early-bootstrap.jsawaitsinitializeNodeNetworkPermissionsbefore importing the main bootstrap module.bootstrap-cdWF4rWM.jsimported. Its later startup logic checks the core gate/package identity and callsMkto register the app-contained resource root.Existing logs are consistent with this ordering: early component resolution reports
source=copiedwhilecoreGateEnabledAtStartup=null; a later startup record reportscoreGateEnabledAtStartup=falseandselectedRuntimeSource=bundled. The build advertises app-contained core support, but this local launch did not enable that branch. These records establish the observed disabled-branch ordering; they do not prove the behavior of a forced-enabled launch.Inference from the inspected sequence: registering the app-contained core only in the later bootstrap appears too late to prevent the earliest materialization on the first launch with a new runtime cache identity. Merely enabling that late gate is therefore not an established fix for first startup after updates. This is a source/log finding for the inspected build, not a tested repaired-client result or a claim about every future version.
Suggested product change: validate the trusted package identity/eligibility and register the accepted in-package core resource root before resolving the initial local app-server launch environment, or make that earliest preparation path explicitly aware of in-package core execution. Preserve all existing package trust and organization/network policy checks. Please verify missing-cache startup after a runtime-changing update and the updater's automatic relaunch, as well as warm cached launches.
This app-contained core path is distinct from the separate
OpenAI.CodexPrimaryRuntimeworkspace-dependency framework. Only sanitized implementation filenames, function identifiers and allowlisted log fields are included; no raw logs, personal paths, account data or application source text are attached.