Windows Codex Desktop exits after bundled executable relocation fails through a broken Junction

Open 💬 1 comment Opened Aug 19, 2026 by f647242979-star

Environment

  • OS: Windows 11 Home, x64
  • Windows version/build: 10.0.26200 / 26200
  • Codex Desktop version: 26.814.5167.0
  • Architecture: x64
  • Installation: Microsoft Store / MSIX
  • Package: OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0

Summary

Codex Desktop repeatedly exited/reset while initializing the local environment.

The filesystem investigation found that:

%LOCALAPPDATA%\OpenAI\Codex

was a Windows Junction pointing to:

E:\Codex\app-runtime

but that target directory no longer existed.

As a result, Codex could not create/relocate its bundled executable into:

%LOCALAPPDATA%\OpenAI\Codex\bin

The logs show ENOENT during mkdir_destination, followed by a missing bundled Electron Codex runtime, then browser/sidebar lifecycle failure, IPC EPIPE, and app-server shutdown.

Relevant log sequence

Codex successfully accessed the configured bundled plugin marketplace first:

bundled_plugins_runtime_marketplace_reused
plugin_marketplace_add_succeeded

Then it failed relocating the bundled executable:

bundled_executable_relocation_failed
destinationPath=C:\Users\HP\AppData\Local\OpenAI\Codex\bin
errorCode=ENOENT
operation=mkdir_destination
originalError={"errno":-4058,"code":"ENOENT","syscall":"mkdir","path":"C:\\Users\\HP\\AppData\\Local\\OpenAI\\Codex\\bin"}
executableName=codex.exe
sourcePath=C:\Program Files\WindowsApps\OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0\app\resources\codex.exe

Immediately afterwards:

bundled_plugins_reconcile_failed
Missing bundled Electron Codex runtime required to sync Chrome plugin app server

Shortly later:

[browser-sidebar-manager] IAB_LIFECYCLE route window is not live
[IpcRouter] Socket error errorCode=EPIPE errorMessage="write EPIPE"
[AppServerConnection] Stopping app-server transport

The app-server connection then transitioned from connected to disconnected.

Filesystem investigation

PowerShell showed:

Name          : Codex
FullName      : C:\Users\HP\AppData\Local\OpenAI\Codex
Attributes    : Directory, ReparsePoint
PSIsContainer : True
LinkType      : Junction
Target        : {E:\Codex\app-runtime}

The Junction target was missing:

Test-Path "E:\Codex\app-runtime"

Result:

False

Manual creation through the Junction also failed:

mkdir "%LOCALAPPDATA%\OpenAI\Codex\bin"

Result:

The system cannot find the path specified.

Workaround tested

Recreating the missing Junction target and bin directory:

New-Item -ItemType Directory -Force "E:\Codex\app-runtime\bin"

Afterwards both checks returned True:

Test-Path "E:\Codex\app-runtime\bin"
Test-Path "$env:LOCALAPPDATA\OpenAI\Codex\bin"

This confirms that the broken Junction was the direct cause of the ENOENT path failure. Final confirmation that the application no longer exits is still being tested.

Expected behavior

If %LOCALAPPDATA%\OpenAI\Codex is a Junction/reparse point whose target no longer exists, Codex Desktop should detect the invalid runtime path and either:

  1. repair/recreate the runtime directory safely,
  2. fall back to a valid local runtime directory, or
  3. show a clear actionable error identifying the unavailable runtime path.

It should not continue into an invalid runtime state and eventually terminate/reset through browser/IPC/app-server failure.

Actual behavior

Codex repeatedly attempts bundled executable relocation, receives ENOENT while creating %LOCALAPPDATA%\OpenAI\Codex\bin, then reports a missing bundled runtime and subsequently loses the browser/sidebar and app-server IPC connection. The user-facing result is an unexplained Codex Desktop exit/reset.

Suggested hardening

During runtime initialization, Codex could explicitly validate %LOCALAPPDATA%\OpenAI\Codex for:

  • reparse points / Junctions,
  • whether the target exists,
  • whether the destination is writable,
  • and whether bin can be created.

If invalid, reporting the actual Junction target and failing gracefully would make this issue much easier to diagnose.

Additional note

It is not yet known whether this Junction was originally created by Codex, by an earlier migration/configuration operation, or manually during previous setup. Regardless of origin, Codex Desktop currently does not handle a broken runtime Junction gracefully.

View original on GitHub ↗

1 Comment

zemeng5208 · 8 days ago

This looks like a high-confidence local runtime relocation/path-integrity failure rather than a model/account issue.

I maintain WinBridge Recovery: https://github.com/zemeng5208/winbridge-recovery

For this specific case, WinBridge may help diagnose and recover the local Windows layer around Codex runtime/helper relocation — in particular whether %LOCALAPPDATA%\OpenAI\Codex is a broken reparse point/Junction, whether the expected bin / runtime destinations are creatable, and whether the user-side relocated runtime state is missing or inconsistent with the installed MSIX package.

The key detail in this report is that relocation fails at mkdir_destination with ENOENT, and the parent %LOCALAPPDATA%\OpenAI\Codex resolves through a Junction whose target no longer exists. That is exactly the kind of local filesystem/runtime-path state WinBridge is intended to inspect and, where safe, reconstruct on the user side.

A couple of important limits:

  • WinBridge does not modify or patch files inside C:\Program Files\WindowsApps.
  • It cannot determine from this report whether Codex itself originally created that Junction; if another tool or manual setup created it, the durable fix is to correct that external configuration.
  • If Codex is supposed to support reparse-point destinations but does not validate/recover a missing Junction target, that remains an upstream robustness bug and WinBridge cannot guarantee a permanent fix.
  • Likewise, if the Desktop build later rewrites the runtime location back into a broken state, local repair can only restore the local layer; it cannot fix that upstream lifecycle behavior.

For triage, I would specifically compare these three layers before and after repair: (1) the MSIX source runtime/binaries, (2) %LOCALAPPDATA%\OpenAI\Codex reparse-point target + bin destination, and (3) any relocated helper/runtime metadata the Desktop expects. If the Junction target is recreated and relocation then succeeds cleanly, that would strongly isolate the failure to the local runtime destination layer.