Skip to content

[Windows] First launch after update takes 6+ minutes due to extremely slow runtime materialization #46338

Open

Description

@cfxgy

On Windows, the first launch of ChatGPT Desktop after an application update can take approximately 6–10 minutes before the UI becomes usable.

Subsequent launches are normal and take only a few seconds.

I performed a local forensic investigation and found that the long startup corresponds closely to the materialization of approximately 4,128 bundled runtime files (~639.9 MB) into "%LOCALAPPDATA%\OpenAI\Codex".

This appears similar to other reports of slow runtime extraction/materialization after updates, but I have not yet determined whether the delay is caused primarily by the application's own file-processing logic, MSIX behavior, Defender, or an interaction between them.

Environment

  • OS: Windows
  • Distribution: Microsoft Store / MSIX
  • Package: "OpenAI.Codex"
  • Package version observed during investigation: "26.911.7940.0"
  • Electron/Chromium: "153.0.8010.36"
  • Package installation volume: "D:\WindowsApps"
  • User runtime/cache: "%LOCALAPPDATA%\OpenAI\Codex"
  • Storage: KIOXIA KBG50ZNV1T02 NVMe SSD
  • Filesystem: NTFS
  • Allocation unit: 4 KB
  • No third-party antivirus/EDR was found

Reproduction
The issue consistently occurs on the first launch after an application update.

Typical sequence:

  1. ChatGPT Desktop updates through Microsoft Store/MSIX.
  2. Launch ChatGPT for the first time after the update.
  3. "ChatGPT.exe" starts, but the UI is unavailable for several minutes.
  4. Thousands of files appear/materialize under:
    • "%LOCALAPPDATA%\OpenAI\Codex\bin"
    • "%LOCALAPPDATA%\OpenAI\Codex\runtimes"
  5. After this process completes, the UI becomes usable.
  6. Close ChatGPT.
  7. Launch it again.
  8. The subsequent launch takes only a few seconds.

Detailed startup timeline
A representative startup was measured on 2026-09-18.

Approximate timeline:
07:35:54 ChatGPT process/startup begins
07:35:54–07:38:10 Large runtime materialization activity
07:38:10 Main materialization activity has completed
07:38:27 ChatGPT UI becomes usable

The measured total startup time from process start to usable UI was approximately:
6 minutes 20 seconds

Approximately:
4 minutes 46 seconds
of that period was associated with the observed bundled-runtime materialization activity.

A subsequent launch:
07:55:46 ChatGPT starts
07:55:52 ChatGPT usable

took approximately:
6 seconds

This large difference between the first post-update launch and subsequent launches is highly reproducible.

Runtime materialization details

During the slow first launch, approximately:
4,128 files
639.9 MB
were created/materialized under:
%LOCALAPPDATA%\OpenAI\Codex\

including files under:
bin
runtimes\

Examples include:
codex.exe ~292.92 MB
code-mode-host ~69.14 MB
node.exe ~89 MB
node_modules ~4,123 files

The files in the user directory were byte-for-byte identical to the corresponding files in the MSIX package.

SHA-256 comparisons matched.

This suggests that the operation is not downloading a different runtime from the network; it is materializing/copying the bundled runtime into the user directory.

Network observation

During the critical materialization window:

07:35:54–07:38:10

no proxy/network connections were observed.

Therefore, the multi-minute delay does not appear to be caused by downloading these runtime files.

Disk / filesystem investigation

I compared the C: and D: volumes because the ChatGPT package was installed under "D:\WindowsApps".

Both volumes are partitions on the same physical SSD:

Disk 0
KIOXIA KBG50ZNV1T02 NVMe SSD

Both use:

NTFS
4 KB allocation unit

Approximate volume sizes:

C: ~249.8 GB, ~118.9 GB free
D: ~703.1 GB, ~252.4 GB free

EFS

The ChatGPT MSIX package on D: is EFS-encrypted.

A sample of WindowsApps packages on C: showed:

162 packages sampled
0 EFS-encrypted

On D:

7 packages sampled
7 EFS-encrypted

However, controlled file-copy benchmarks indicate that EFS cannot explain the multi-minute startup delay.

Controlled 4,123-file copy benchmark

Approximately 4,123 files were copied under controlled conditions.

Results:

D: EFS package → C: temporary directory
5.55 seconds
~743 files/s

D: EFS package → D: temporary directory
5.52 seconds
~746 files/s

C: non-EFS source → D: temporary directory
3.66 seconds
~1,126 files/s

C: non-EFS source → C: temporary directory
3.42 seconds
~1,138 files/s

Thus, the EFS source adds only roughly 2 seconds in this benchmark.

That is negligible compared with the approximately 286 seconds of observed materialization activity.

This also suggests that simply moving the application from D: to C: is unlikely to eliminate the multi-minute delay.

Cold vs. warm file access

Additional testing showed that newly introduced/sufficiently cold small files can be much slower to access than already-warmed files.

However, the extremely slow behavior observed during the ChatGPT post-update startup was substantially worse than the normal cold-read behavior.

Once the files had been processed/materialized, subsequent launches were thousands of files per second / only a few seconds overall.

This strongly suggests that the problem is specific to the post-update first-touch/materialization path rather than a persistent storage performance problem.

Filesystem filter drivers

The same system-level filesystem filters were observed on both volumes, including:

WdFilter Windows Defender
FileCrypt BitLocker
ahflt Microsoft PC Manager
BEDaisy BattlEye

No third-party antivirus/EDR was identified.

Windows Defender ("MsMpEng.exe") was active around the relevant period.

However, I have not yet established that Defender accounts for the majority of the approximately 286 seconds of materialization time.

I therefore do not want to claim that Defender is the root cause without a ProcMon trace.

What appears to be happening

The observed sequence appears to be approximately:

MSIX update
↓
First launch
↓
Bundled runtime is materialized into
%LOCALAPPDATA%\OpenAI\Codex
↓
~4,128 files / ~640 MB
↓
Very slow processing of many individual files
↓
ChatGPT UI becomes usable
↓
Subsequent launches are fast

The fact that:

  • the files already exist inside the MSIX package,
  • the copied files are byte-for-byte identical,
  • there is no observed network activity,
  • the storage device performs normally in controlled tests,
  • EFS adds only a few seconds in the benchmark,
  • and subsequent launches take ~6 seconds,

makes the post-update runtime materialization path the strongest correlation I have found so far.

Defender hypothesis

Defender may contribute to the slowdown because thousands of newly materialized executable/script/module files are being touched for the first time.

However, current evidence does not establish Defender as the primary bottleneck.

I have not disabled Defender or added exclusions.

A future Process Monitor capture can determine whether:

ChatGPT.exe file operations

are being delayed in correlation with:

MsMpEng.exe / WdFilter

or whether ChatGPT itself is spending most of the time performing serialized file operations.

Previous update-staging observations

There is also evidence that the MSIX update/staging process itself can take several minutes before the first launch.

Observed examples include approximately:

2026-09-17 448.8 seconds
2026-09-16 225.5 seconds
2026-09-15 272.8 seconds

These appear to be separate from the measured first-launch materialization delay.

Therefore, the user's perceived total "update → usable ChatGPT" time can be even longer than the approximately 6-minute first-launch measurement.

Other observations

No ChatGPT application crash or Windows Error Reporting event was found for the slow launch.

No evidence of:

  • GPU initialization failure
  • memory pressure
  • SSD saturation
  • database migration taking several minutes
  • update process deadlock

was found during the investigation.

The system otherwise appears healthy.

Expected behavior

After an application update, ChatGPT Desktop should become usable within seconds or should avoid blocking the first UI launch for several minutes while synchronously materializing thousands of bundled runtime files.

Actual behavior

The first launch after an update can take approximately:

6–10+ minutes

with approximately:

4,128 files
~639.9 MB

being materialized before the application becomes usable.

Subsequent launches take only a few seconds.

Requested investigation

Could the Windows/MSIX startup path be investigated to determine whether the bundled runtime can be:

  • materialized asynchronously,
  • reused directly from the MSIX package where possible,
  • extracted during the update rather than blocking the first launch,
  • or otherwise optimized to avoid processing thousands of individual files synchronously?

I can provide a Process Monitor (".PML") capture from the next update to correlate:

  • "ChatGPT.exe"
  • "MsMpEng.exe"
  • "CreateFile"
  • "ReadFile"
  • "WriteFile"
  • file-operation duration
  • and the runtime materialization timeline.

The main question is why approximately 4,128 already-bundled files require several minutes to become usable after every update.

Activity

  1. added
    bug
    app
    windows-os
    on Sep 18, 2026
  2. changed the title [-][Windows] First launch after update takes 6+ minutes due to extremely slow runtime materialization (~4,128 files)[/-] [+][Windows] First launch after update takes 6+ minutes due to extremely slow runtime materialization[/+] on Sep 18, 2026
  3. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. Just1dream commented on Sep 24, 2026

    @Just1dream

    Independent reproduction on a newer Windows build. I think this adds a useful distinction to this issue:

    The old UNKNOWN / errno -4094 relocation failure appears to be handled now by a fallback, but that fallback itself can become a severe first-launch performance bottleneck.

    Environment

    • ChatGPT/Codex Windows app: 26.917.9434.0
    • Microsoft Store / MSIX
    • Package stored on a secondary AppX volume under WindowsApps
    • User runtime: %LOCALAPPDATA%\OpenAI\Codex
    • Windows Defender real-time protection: disabled

    Observed startup behavior

    First launch after the update:

    • host startup critical path: ~225.98 s
    • cua_node materialization occupies roughly ~212 s of that period
    • 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. Instead, the Electron main event loop appears to be blocked during the first-launch runtime relocation, so the 5 s timer itself cannot run on time.


    Experiment 1: identify exactly what is created during the slow first launch

    During the slow launch I monitored %LOCALAPPDATA%\OpenAI\Codex.

    For the cua_node runtime specifically:

    • 2,283 files
    • ~239 MB
    • source: packaged app\resources\cua_node
    • destination: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>

    Across the full relocation window, about:

    • 2,288 files
    • ~640.3 MB

    were created under %LOCALAPPDATA%\OpenAI\Codex.

    The timestamps line up very closely with the period in which the UI is unavailable.


    Experiment 2: rule out raw source-read performance

    I read the complete 2,283-file cua_node tree without writing anything.

    Results:

    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
    

    Conclusion: simply reading the packaged runtime is fast enough that raw package-read throughput cannot explain a multi-minute stall.


    Experiment 3: controlled normal tree copy

    I then copied the same 2,283 files using a straightforward byte-stream tree copy, outside the ChatGPT code path.

    Results:

    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 two results are very close.

    Conclusion: the secondary AppX volume / cross-volume layout is not enough by itself to explain ~2-4 minutes of delay.


    Experiment 4: inspect the current relocation implementation

    I inspected the current packaged app.asar.

    The Windows relocation helper effectively does this for each file:

    try {
      fs.copyFileSync(src, dst)
    } catch (e) {
      // handles errno 6000 or UNKNOWN/-4094
      fs.writeFileSync(dst, fs.readFileSync(src))
    }

    The surrounding directory traversal and validation path also uses synchronous APIs such as:

    readdirSync
    statSync
    copyFileSync
    readFileSync
    writeFileSync
    mkdirSync
    renameSync
    rmSync
    

    So this work is happening synchronously on the startup path.


    Experiment 5: reproduce the current fallback path directly

    To test whether the fallback itself is expensive, I wrote a small Node.js reproduction using the same strategy:

    1. recursively enumerate the packaged cua_node tree;
    2. call fs.copyFileSync(src, dst) for every file;
    3. if it throws UNKNOWN / -4094, fall back to fs.readFileSync(src) + fs.writeFileSync(dst);
    4. count direct-copy successes vs fallback hits;
    5. delete the temporary output after the test.

    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 single one of the 2,283 files first failed with:

    code = UNKNOWN
    errno = -4094
    syscall = copyfile
    

    before taking the synchronous fallback.

    Progress during the run was approximately:

     250 files ->  15.45 s
     500 files ->  34.90 s
    1000 files ->  66.76 s
    1500 files ->  92.37 s
    2000 files -> 115.00 s
    2283 files -> 127.98 s
    

    This is the most important result:

    normal byte-stream copy:   ~13.2 s
    current fallback strategy: ~128.0 s
    actual first launch:       ~226.0 s
    

    So on this machine, reproducing the current fallback strategy is already about 10x slower than a straightforward copy before accounting for the rest of Electron startup work.


    Interpretation

    This looks less like the original "-4094 causes relocation to fail" problem and more like a performance side effect of the fallback that now prevents that hard failure.

    The likely sequence is:

    first launch after update
      -> new runtime hash is missing locally
      -> relocation starts
      -> copyFileSync fails for every packaged file with UNKNOWN/-4094
      -> every file pays exception + fallback cost
      -> fallback performs synchronous readFileSync/writeFileSync
      -> thousands of synchronous operations block the Electron main process
      -> timers/window startup are delayed
      -> relocation finishes
      -> UI becomes responsive
      -> subsequent launches are fast because the new hash already exists
    

    This also explains why a nominal 5-second timer is observed only after ~220 seconds.


    Potential fixes

    The exact implementation choice is of course up to the Windows/Desktop team, but the measurements suggest several concrete options:

    1. Avoid the guaranteed failed copyFileSync attempt for packaged files that consistently return UNKNOWN/-4094.
      Once this source condition is detected, select the alternate copy path once instead of throwing and catching once per file.

    2. Use a Windows-native copy path that supports protected/encrypted package files.
      For example, equivalent semantics to COPY_FILE_ALLOW_DECRYPTED_DESTINATION rather than relying on Node's generic copyFileSync and then falling back file-by-file.

    3. Move runtime materialization off the Electron main thread.
      Even if the byte-stream fallback must remain, doing it in a worker/child process would avoid blocking window creation, IPC and timers.

    4. Materialize during update/install staging when possible.
      That would keep the first user-visible launch off the critical path.

    5. If the fallback is retained, detect the condition once.
      One failed probe could switch the whole tree to the fallback mode, avoiding thousands of predictable exceptions.

    Why I think this may be actionable

    The current fallback appears to solve the older functional failure - the runtime eventually materializes successfully - but on this system it converts the failure into a multi-minute main-thread stall.

    The controlled experiments above isolate the slowdown fairly well:

    • package reads are fast;
    • normal copies are fast;
    • cross-volume layout alone is not enough to explain it;
    • reproducing the current fallback strategy is dramatically slower;
    • all 2,283 files hit the same UNKNOWN/-4094 path.

    I can provide the exact startup-log excerpts and the minimal Node.js reproduction script if that would help with verification.

  5. hengweiyv commented on Oct 2, 2026

    @hengweiyv

    I had the same symptom with the Windows Store Codex app installed on a secondary (D:) AppX volume: opening it could take minutes, then the window would appear. Moving Codex back to the system (C:) AppX volume with Windows' supported package migration resolved the delay on my PC.

    For anyone in that situation, close Codex and back up your app data first, then check which AppX volume actually holds the package and use Move-AppxPackage to move it to the system volume. Microsoft's documentation says this cmdlet moves the package and its app data: https://learn.microsoft.com/en-us/powershell/module/appx/move-appxpackage

    This is one confirmed workaround for a secondary-volume installation, not proof that every slow startup has the same cause. I have not yet verified the first launch after a future update.

  6. zhaozetong commented on Nov 6, 2026

    @zhaozetong

    I also experienced startup delays of several minutes after an update. Here is another case where the app was already installed on C:, along with a workaround that succeeded on my machine.

    App version:

    OpenAI.Codex 26.1103.3517.0
    

    Installation location:

    C:\Program Files\WindowsApps\OpenAI.Codex_26.1103.3517.0_x64__2p2nqsd0c76g0
    

    Bundled runtime source:

    <InstallLocation>\app\resources\cua_node
    

    Local runtime directory:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node
    

    During investigation, bin\node.exe in the source directory had the attributes Archive, Encrypted. The app created the following staging directories during startup, while the main window remained unavailable:

    .staging-c4873bdffed0b168-Tu1ZwQ
    .staging-c4873bdffed0b168-WPoCBD
    

    Based on the direct read/write approach discussed in this issue and the manual runtime preparation workaround in #47724, I used PowerShell to:

    1. Terminate the ChatGPT processes.
    2. Read the complete cua_node tree from the currently installed package.
    3. Copy each file’s contents into a new temporary directory using .NET ReadAllBytes / WriteAllBytes.
    4. Rename the temporary directory to the expected final runtime directory after copying completed.
    5. Open ChatGPT again from the Start menu.

    Result: 2,461 files were copied in 4.07 seconds, and ChatGPT subsequently opened successfully.

    Below is the script that worked in this case. The runtime ID c4873bdffed0b168 came from the .staging-<ID>-… directory created during this launch. Other versions should use their corresponding runtime ID. Running the script forcibly terminates ChatGPT.

    & {
        $ErrorActionPreference = "Stop"
    
        $package = Get-AppxPackage -Name OpenAI.Codex
        if ($package.Version.ToString() -ne "26.1103.3517.0") {
            throw "The app version has changed. Stop and confirm the runtime ID again."
        }
    
        $source = Join-Path $package.InstallLocation "app\resources\cua_node"
        $root = "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node"
        $final = Join-Path $root "c4873bdffed0b168"
        $staging = Join-Path $root ("manual-copy-" + [guid]::NewGuid().ToString("N"))
    
        Get-Item -LiteralPath "$source\bin\node.exe" | Out-Null
    
        Get-Process -Name ChatGPT -ErrorAction SilentlyContinue |
            Stop-Process -Force
    
        if (Test-Path -LiteralPath $final) {
            throw "The final directory already exists. Copying stopped to avoid overwriting it. Try reopening ChatGPT."
        }
    
        $files = @(Get-ChildItem -LiteralPath $source -Recurse -File -Force)
        [System.IO.Directory]::CreateDirectory($staging) | Out-Null
        $watch = [System.Diagnostics.Stopwatch]::StartNew()
        $completed = 0
    
        foreach ($file in $files) {
            $relative = $file.FullName.Substring($source.Length).TrimStart('\')
            $destination = Join-Path $staging $relative
    
            [System.IO.Directory]::CreateDirectory(
                [System.IO.Path]::GetDirectoryName($destination)
            ) | Out-Null
    
            $bytes = [System.IO.File]::ReadAllBytes($file.FullName)
            [System.IO.File]::WriteAllBytes($destination, $bytes)
    
            $completed++
            if ($completed % 100 -eq 0) {
                Write-Host "Copied $completed / $($files.Count) files"
            }
        }
    
        # Preserve empty directories from the source runtime.
        Get-ChildItem -LiteralPath $source -Recurse -Directory -Force |
            ForEach-Object {
                $relative = $_.FullName.Substring($source.Length).TrimStart('\')
                [System.IO.Directory]::CreateDirectory(
                    (Join-Path $staging $relative)
                ) | Out-Null
            }
    
        Move-Item -LiteralPath $staging -Destination $final
        $watch.Stop()
    
        Write-Host "Completed: $completed files in $([math]::Round($watch.Elapsed.TotalSeconds, 2)) seconds"
        Write-Host "Final directory: $final"
    }

    This PowerShell script was written during troubleshooting using the paths observed on my machine, drawing on the community’s existing analysis. In this case, direct read/write operations prepared the runtime quickly and restored startup for the installed version. A future update that changes the runtime ID may require preparing the corresponding runtime again.

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