Skip to content

[Windows] UNKNOWN/-4094 copy fallback causes ~10x runtime relocation slowdown and blocks Electron main thread #47770

Open

Description

@Just1dream

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_node materialization 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:

  1. recursively enumerate the packaged cua_node tree;
  2. call fs.copyFileSync(src, dst) for every file;
  3. on UNKNOWN/-4094, fall back to fs.readFileSync(src) + fs.writeFileSync(dst);
  4. count direct-copy successes and fallback hits;
  5. 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?

  1. Install/update Codex App from Microsoft Store/MSIX to a build whose runtime hash has not yet been materialized locally.
  2. Launch the app for the first time after the update.
  3. Observe that the usable window is delayed for minutes while files are created under %LOCALAPPDATA%\OpenAI\Codex\runtimes and bin.
  4. Close the app after it becomes usable.
  5. Launch the same version again; startup returns to a few seconds.
  6. To reproduce the implementation-level slowdown independently, run the same per-file strategy against the packaged cua_node tree: try fs.copyFileSync, catch UNKNOWN/-4094, then use fs.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/-4094 source 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 copyFileSync followed 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

  1. added
    app
    on Sep 24, 2026
  2. added
    bug
    windows-os
    on Sep 24, 2026
  3. github-actions commented on Sep 24, 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
    Author

    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/-4094 fallback 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.

  5. 2390471470-pixel commented on Oct 5, 2026

    @2390471470-pixel

    Posting an additional reproduction and sanitized diagnostic logs at the affected user's request. This confirms the repeated UNKNOWN/-4094 per-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 current phase=preparation failure should be distinguished from the older phase=policy-read failures.

    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

    • Codex MSIX/AppX: OpenAI.Codex 26.930.4958.0, x64; package status normal.
    • Windows 11 Home, Chinese edition; OS version 10.0.26200, build 26200.
    • Codex executable Authenticode signature: Valid, OpenAI OpCo, LLC.
    • Registered route: C:\Program Files\WindowsApps\<package>. The registered package directory is a junction to D:\WindowsApps\<package>; both routes refer to the same installed package.
    • Runtime destinations: %LOCALAPPDATA%\OpenAI\Codex\bin\<hash> and %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>.

    Reproduction and behavior

    1. Install a Codex update through the existing update flow.
    2. Launch the updated application with its new runtime cache absent.
    3. Wait for the organization-settings warning.
    4. Select Retry; the application starts successfully. Subsequent launches of that version do not show the warning in the retained logs.

    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:

    Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false
    

    After Retry, configRequirements/read succeeds (errorCode=null), as does account querying.

    Current-version evidence

    Independent file timestamps show the new cua_node cache 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:

    • initializeNodeNetworkPermissions first awaits runtime preparation, then enters policy-read.
    • Preparation uses 120000 milliseconds and checks elapsed time after the Promise resolves. Synchronous copying can block the timer callback and still trigger the elapsed-time check afterward.
    • Missing content-hash caches cause synchronous recursive copying of the complete cua_node tree, including node_modules.
    • Manual Retry preserves the preparation Promise when the failed phase is preparation. The copy has already completed, so the next iteration can proceed immediately; Retry itself does not reload/relaunch the application.
    • Early logging buffers messages without original timestamps. Entries are timestamped when flushed after startup resumes, explaining why preparation and timeout entries share a much later timestamp. File-creation times provide separate timing evidence.

    Copy-path reproduction

    Installed source files have the Encrypted attribute. The bundled copy routine tries copyFileSync, then falls back to readFileSync/writeFileSync for errno 6000, or UNKNOWN/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:

    Source route Native-copy attempt plus fallback Direct read/write
    Actual D installation 2,245 ms 41 ms
    Registered C junction route 4,003 ms 64 ms

    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/-4094 alone 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 reported preparation. 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
    Codex for Windows: startup organization-settings warning after updates
    Selected, redacted diagnostic excerpts. Not complete raw logs.
    Collected 2026-10-05; display timezone Asia/Tokyo (UTC+09:00).
    
    Selection and privacy rules
    - Included only six startup-policy warning records; twenty allowlisted startup records from the current run; successful package-registration summaries; runtime file timestamps; and three controlled copy-test result objects.
    - Excluded chat text, session/history contents, tokens, cookies, account response bodies, configuration bodies, complete source code, and unrelated log records.
    - User-profile paths, run/request/conversation/thread identifiers, process/window identifiers, SIDs, and URL query strings are redacted. Package versions, runtime content hashes, durations, and error codes are retained.
    - Original startup records were buffered before normal logging initialized. The timestamps below are recorded/flush timestamps, not reliable timestamps for when the dialog first appeared.
    
    Environment / symptom
    Current account package: OpenAI.Codex; version=26.930.4958.0; status=Ok
    OS: Windows; version=10.0.26200; build=26200; architecture=x64
    User reports the organization-settings warning after each update; selecting Retry allows normal use.
    Screenshot: 2026-10-05 18:02:21 +09:00; current normal log begins 18:02:27 +09:00.
    The current process was created at 17:29:00 +09:00, immediately after package registration.
    
    Six selected historical warnings (each first observed run of a new version)
    version=26.928.2636.0; original line=6; 2026-09-30T11:50:18.036Z warning Desktop startup policy read failed attempt=1 phase=policy-read reason=timeout retrying=false
    version=26.928.3736.0; original line=6; 2026-10-01T06:26:37.724Z warning Desktop startup policy read failed attempt=1 phase=policy-read reason=timeout retrying=false
    version=26.928.4866.0; original line=6; 2026-10-02T05:05:22.628Z warning Desktop startup policy read failed attempt=1 phase=policy-read reason=timeout retrying=false
    version=26.930.2377.0; original line=6; 2026-10-02T11:07:11.443Z warning Desktop startup policy read failed attempt=1 phase=policy-read reason=timeout retrying=false
    version=26.930.3930.0; original line=5; 2026-10-03T13:01:36.267Z warning Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false
    version=26.930.4958.0; original line=5; 2026-10-05T09:02:27.104Z warning Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false
    Scope: 21 distinct main-process initial log files (*t0-i1*0.log), 2026-09-30 through 2026-10-05; all six versions first observed in this range have this warning; the other 15 same-version runs do not.
    Earlier phase=policy-read records are retained as historical evidence and are not asserted to have the same root cause as current phase=preparation.
    
    Current run: twenty allowlisted diagnostic lines after Retry
    L1: 2026-10-05T09:02:27.104Z info windows_core_runtime_component_resolved appPackageCoreActive=false architecture=x64 component=codex consumer=resolver copiedRuntimeLocation=true coreGateEnabledAtStartup=null executablePath=[LOCAL_CODEX_CACHE]\bin\f544b3844e0f14e9\codex.exe source=copied
    L3: 2026-10-05T09:02:27.104Z info windows_core_runtime_component_resolved appPackageCoreActive=false architecture=x64 component=node consumer=resolver copiedRuntimeLocation=true coreGateEnabledAtStartup=null executablePath=[LOCAL_CODEX_CACHE]\runtimes\cua_node\7d8d3ac5ca9f6767\bin\node.exe source=copied
    L4: 2026-10-05T09:02:27.104Z info windows_core_runtime_component_resolved appPackageCoreActive=false architecture=x64 component=ripgrep consumer=resolver copiedRuntimeLocation=true coreGateEnabledAtStartup=null executablePath=[LOCAL_CODEX_CACHE]\bin\6de5bf5fa8384f8d\rg.exe source=copied
    L5: 2026-10-05T09:02:27.104Z warning Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false
    L6: 2026-10-05T09:02:27.104Z info [StdioConnection] stdio_transport_spawned argsCount=4 coreRuntimeInUse=false executablePath=[LOCAL_CODEX_CACHE]\bin\f544b3844e0f14e9\codex.exe pid=[REDACTED] spawnCommand=[LOCAL_CODEX_CACHE]\bin\f544b3844e0f14e9\codex.exe
    L7: 2026-10-05T09:02:27.136Z info [sparkle] in_app_updates_policy_wait_started timeoutMs=300000
    L8: 2026-10-05T09:02:27.136Z info windows_core_runtime_launch_selected architecture=x64 buildFlavor=prod coreGateEnabledAtStartup=false selectedRuntimeSource=bundled
    L9: 2026-10-05T09:02:27.247Z info Launching app agentRunId=[REDACTED] allowDebugMenu=false allowDevtools=false allowInspectElement=false buildFlavor=prod enableSparkle=false enableUpdater=true nodeEnv=undefined packaged=true platform=win32
    L38: 2026-10-05T09:02:27.586Z info [AppServerConnection] initialize_handshake_result durationMs=106 initializeRequestId=[REDACTED] outcome=success transportKind=stdio
    L39: 2026-10-05T09:02:27.586Z info [AppServerConnection] Codex CLI initialized
    L40: 2026-10-05T09:02:27.587Z info [AppServerConnection] app_server_connection.state_changed cause=post_initialize_connection_state connectionError=null currentConnectionId=[REDACTED] currentState=connecting hasConnection=true hostId=local initialized=true initializeInFlight=false next=connected pendingClientRequests=0 pendingInternalRequests=0 previous=connecting reconnectAttempt=0 reconnectTimerScheduled=false restartInFlight=false targetConnectionId=[REDACTED] targetReadyState=1 transport=stdio
    L45: 2026-10-05T09:02:27.778Z info [startup] [0.532] Host startup critical-path phases completed startupElapsedMs=686 startupPhaseDurationsMs={"bootstrap handoff complete":154,"main app.whenReady resolved":0,"registered app protocol":0,"local data migrations completed":0,"registered deep link protocol":0,"startup window revealed":329,"local app-server sqlite initialized":123,"window context initialized":124,"application menu refreshed":2,"bundled plugins reconcile checked":0}
    L67: 2026-10-05T09:02:31.310Z info [electron-message-handler] [chatgpt-account-lookup] completed accountInfoHttpStatus=undefined accountsHttpStatus=undefined authenticatedAccountPresent=true authMethod=chatgpt failureType=undefined hasEverErrored=false rendererWebContentsId=[REDACTED] rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=[REDACTED] rendererWindowVisible=true result=succeeded windowType=electron
    L83: 2026-10-05T09:02:32.215Z info [AppServerConnection] response_routed broadcastFallback=false conversationId=[REDACTED] durationMs=4 errorCode=null hadInternalHandler=false hadPending=true method=configRequirements/read originWebcontentsId=1 queueWaitMs=0 requestId=[REDACTED] targetDestroyed=false
    L112: 2026-10-05T09:02:32.442Z info [AppServerConnection] initialize_handshake_result durationMs=39 initializeRequestId=[REDACTED] outcome=success transportKind=websocket
    L113: 2026-10-05T09:02:32.442Z info [AppServerConnection] Codex CLI initialized
    L114: 2026-10-05T09:02:32.442Z info [AppServerConnection] app_server_connection.state_changed cause=post_initialize_connection_state connectionError=null currentConnectionId=[REDACTED] currentState=connecting hasConnection=true hostId=durable initialized=true initializeInFlight=false next=connected pendingClientRequests=3 pendingInternalRequests=0 previous=connecting reconnectAttempt=0 reconnectTimerScheduled=false restartInFlight=false targetConnectionId=[REDACTED] targetReadyState=1 transport=websocket
    L140: 2026-10-05T09:02:33.095Z info [sparkle] in_app_updates_policy_latch enabled=true ignored=false policy=pending
    L176: 2026-10-05T09:02:33.260Z info [windows-store-updater] Checking Windows Store for package updates buildVersion=26.930.4958.0 manifestBuildVersion=26.930.6422.0 packageIdentity=OpenAI.Codex
    L237: 2026-10-05T09:02:35.628Z info [windows-store-updater] Windows Store package update check completed canSilentlyDownload=true completed=false hasUpdate=false overallState=NoUpdates
    Account/configRequirements entries above contain event metadata only, no account IDs or response bodies.
    
    Windows deployment events: normalized summaries, not verbatim exports
    Source: Microsoft-Windows-AppXDeploymentServer/Operational; Event ID 400.
    2026-10-02T11:03:02Z / 20:03:02+09:00: Register OpenAI.Codex_26.930.2377.0_x64__2p2nqsd0c76g0 on D: succeeded.
    2026-10-03T12:57:00Z / 21:57:00+09:00: Register OpenAI.Codex_26.930.3930.0_x64__2p2nqsd0c76g0 on D: succeeded.
    2026-10-05T08:29:00Z / 17:29:00+09:00: Register OpenAI.Codex_26.930.4958.0_x64__2p2nqsd0c76g0 on D: succeeded.
    
    Runtime preparation: observed filesystem metadata
    {
      "runtimeHash": "7d8d3ac5ca9f6767",
      "fileCount": 2367,
      "totalBytes": 251349224.0,
      "firstFileCreationTime": "2026-10-05T17:29:03.5787143+09:00",
      "lastFileCreationTime": "2026-10-05T17:32:55.3109300+09:00",
      "fileCreationSpanSeconds": 231.7322157,
      "startupPreparationBudgetSeconds": 120
    }
    The file-creation span is filesystem evidence, not an instrumented measurement of the complete startup or proof of precise elapsed time spent in a particular API.
    Installed implementation inspection: preparation includes synchronous content hashing and recursive runtime copying; the current preparation deadline is 120 seconds. A completed cached preparation promise can be reused on Retry.
    This is a diagnostic summary; no application source files are attached.
    
    Controlled performance experiments (after diagnosis; not original startup timings)
    60-file sample; source is physical D: package location
    {
      "source": "[INSTALLED_PACKAGE_D]\\app\\resources\\cua_node\\bin\\node_modules",
      "runRoot": "[SCRATCH]",
      "results": [
        {
          "method": "copy-with-fallback",
          "fileCount": 60,
          "bytes": 330927,
          "durationMs": 2245.1537000000003,
          "errors": {
            "UNKNOWN/-4094": 60
          },
          "verified": true
        },
        {
          "method": "read-write",
          "fileCount": 60,
          "bytes": 330927,
          "durationMs": 41.20749999999998,
          "errors": {},
          "verified": true
        }
      ]
    }
    Same 60-file sample; source is registered C: package alias
    {
      "source": "[REGISTERED_PACKAGE_C]\\app\\resources\\cua_node\\bin\\node_modules",
      "runRoot": "[SCRATCH]",
      "results": [
        {
          "method": "copy-with-fallback",
          "fileCount": 60,
          "bytes": 330927,
          "durationMs": 4003.4727999999996,
          "errors": {
            "UNKNOWN/-4094": 60
          },
          "verified": true
        },
        {
          "method": "read-write",
          "fileCount": 60,
          "bytes": 330927,
          "durationMs": 64.40790000000015,
          "errors": {},
          "verified": true
        }
      ]
    }
    Full runtime read/write copy and SHA-256 validation in scratch space
    {
      "source": "[INSTALLED_PACKAGE_D]\\app\\resources\\cua_node",
      "destination": "[SCRATCH]",
      "files": 2367,
      "bytes": 251349224,
      "copyMs": 2736,
      "verifyMs": 1582,
      "targetFiles": 2367,
      "sha256MatchedFiles": 2367,
      "failures": []
    }
    The registered C: package directory is a junction to the physical D: package directory; both sample tests read the same installed version.
    All 60 sample copy-with-fallback operations reported UNKNOWN/-4094 before fallback; read/write operations had no reported errors and verified successfully.
    The full read/write validation copied 2367 files / 251349224 bytes; all 2367 SHA-256 values matched; no failures.
    No installed application binaries, security exclusions, network policies, or organization requirements were changed by these diagnostic experiments.
    
  6. zzzzzhi421-art commented on Oct 8, 2026

    @zzzzzhi421-art

    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:

    Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false
    

    The configuration is already windows.sandbox = "unelevated", so changing to that mode did not prevent recurrence. The installed implementation performs runtime preparation before policy-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 explicitly phase=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_node tree contains 2365 files / 251,216,888 bytes. All tests wrote fresh isolated diagnostic directories, without clearing or modifying the live cache.

    Copy strategy Tree copy plus source hashing Native-copy errors Destination SHA-256 verification
    Current strategy: try copyFileSync for every file, then existing read/write fallback 381.6 s 2365 2365/2365 match
    Direct content read/write 6.3 s Native copy not called 2365/2365 match
    Candidate: after the first recognized failure, use content copy for the rest of this tree operation 10.4 s 1 2365/2365 match

    Destination 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 Win32 CopyFileW probe failed for all 12 packaged source files with error 6000, whose local error text is "无法加密指定的文件。" (The specified file could not be encrypted.) The source node.exe has 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 every UNKNOWN/-4094 error 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:

    1. Avoids repeating the same failing native copy for every remaining file once the existing recognized fallback condition has been observed within this WindowsApps runtime relocation operation.
    2. Preserves staging, content validation, atomic publication, and propagation of unrelated errors; does not weaken organization-policy enforcement.
    3. Moves costly preparation off the Electron main thread and reports local preparation failures distinctly from organization/network failures.
    4. Is validated through the updater's own automatic relaunch as well as ordinary startup after a Windows restart. A separate user launcher does not cover every update path.

    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.

  7. analistadev1 commented on Oct 17, 2026

    @analistadev1

    Runtime relocation copy failures exceed preparation timeout and show misleading organization-settings error (Windows desktop 26.1013.4894.0)

    Environment

    • Date observed: October 17, 2026 (local time, Lima)
    • Codex desktop: 26.1013.4894.0
    • Codex CLI: 0.163.0-alpha.10.2
    • Bundled Node.js: 24.21.0
    • The Store package was installed on the D: drive; the runtime cache was on the C: drive.
    • The packaged runtime source was available through the Windows package location. Its C: Program Files\WindowsApps alias and actual D: WindowsApps location 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=preparation and 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

    Component Path / configuration
    Installed package (actual D: HDD location) D:\WindowsApps\OpenAI.Codex_26.1013.4894.0_x64__2p2nqsd0c76g0\app\resources\cua_node
    Windows logical package alias C:\Program Files\WindowsApps\OpenAI.Codex_26.1013.4894.0_x64__2p2nqsd0c76g0\app\resources\cua_node; resolves to the D: package files
    Runtime cache (C: SSD) %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<content-hash>
    Application-private Node.js <runtime-cache>\bin\node.exe
    Global Node.js C:\Program Files\nodejs\node.exe; not implicated by the observed process timeline
    Other volume E: SSD was not involved

    The 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_node runtime tree. The reproduction used synchronous file copy, falling back to buffered read/write when copyFileSync failed:

    1. Enumerate and copy the packaged runtime tree into a temporary destination owned by the reproduction.
    2. For each file, try copyFileSync. When it fails with UNKNOWN / errno -4094, read the source file and write its contents to the destination.
    3. Leave the source tree untouched and clean up only the temporary destination created for the reproduction.

    Results for the same tree (2,369 files, 252,264,432 bytes, 337 directories):

    • copyFileSync failed for all 2,369 files with UNKNOWN / errno -4094.
    • The full try-copyFileSync-then-buffered-fallback strategy completed without errors in 138.452 seconds.
    • A buffered copy directly across the same tree completed without errors in 3.598 seconds, about 38.5 times faster.

    The isolated reproduction retained no script. These steps describe the method and observed results rather than a complete standalone repro program.

    Diagnostics

    • The sanitized log entry was: Desktop startup policy read failed attempt=1 phase=preparation reason=timeout retrying=false.
    • All 2,369 source files were encrypted with EFS; none of the copied local files were encrypted. This is consistent with a possible interaction but does not prove EFS alone caused the failure.
    • The Windows package alias and actual package location resolved to the same files. Copying from either location failed in the same way.
    • Hashes for manifest.json, bin/node.exe, and bin/node_repl.exe matched between the installed source and runtime cache.
    • VS Code was not running, there were no configuration overrides, and the app's private Node runtime is distinct from the system Node installation.
    • Similar delays were also observed during earlier runtime changes this month. No runtime corruption has been confirmed.

    Suggested investigation

    The measured bottleneck is the repeated failed copyFileSync attempts 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's copyFileSync operations 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.

  8. S4kuzy0 commented on Oct 19, 2026

    @S4kuzy0

    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

    • Windows x64, OS build 26200.
    • Store/MSIX package: OpenAI.Codex 26.1013.4894.0.
    • Application version: 26.1013.40934, build 20770, production channel.
    • Application-bundled Node: v24.21.0; libuv: 1.52.1.
    • Sample source: <installed-package>/app/resources/cua_node/manifest.json, with the Encrypted attribute.
    • Every test wrote a separate new destination in an isolated local diagnostic directory. The packaged source and live runtime cache were left unchanged.

    Observed copy results for the same source file

    Method Result
    CopyFileW Failed: ERROR_ENCRYPTION_FAILED (6000)
    CopyFileExW without COPY_FILE_ALLOW_DECRYPTED_DESTINATION Failed: ERROR_ENCRYPTION_FAILED (6000)
    CopyFileExW with COPY_FILE_ALLOW_DECRYPTED_DESTINATION Succeeded; destination SHA-256 matched the source
    Direct byte-stream read/write Succeeded; destination SHA-256 matched the source
    Current bundled Node fs.copyFileSync Failed: code="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/-4094 error is encryption-related.

    Installed implementation findings

    Read-only inspection of the current packaged JavaScript shows:

    • Runtime relocation still tries synchronous copyFileSync separately 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.
    • Local launch preparation is awaited before the startup policy RPC, under a separate preparation deadline. This is consistent with the first-launch failure mode tracked in this issue; changing account/network settings would not correct that copy path.
    • Separately, windows-file-copy-B2PsciEv.js checks errno === 6000 for its asynchronous encrypted-copy fallback. The observed Node error has errno === -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 UNKNOWN errors 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.0 package, the startup sequence is:

    1. early-bootstrap.js awaits initializeNodeNetworkPermissions before importing the main bootstrap module.
    2. That function first resolves/prepares the local app-server launch environment. Resolution includes the bundled CLI, Node runtime and ripgrep; a missing runtime/cache identity can enter the current relocation/copy path at this point, before the startup policy RPC.
    3. Only after this startup-requirements stage succeeds is bootstrap-cdWF4rWM.js imported. Its later startup logic checks the core gate/package identity and calls Mk to register the app-contained resource root.
    4. The runtime resolver uses package paths without relocation once that root has been registered.

    Existing logs are consistent with this ordering: early component resolution reports source=copied while coreGateEnabledAtStartup=null; a later startup record reports coreGateEnabledAtStartup=false and selectedRuntimeSource=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.CodexPrimaryRuntime workspace-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.

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