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

Open
#39,475 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
electron, rust
Domain
desktop

Research direction

Start by tracing desktop runtime initialization and the bundled executable relocation path described by the mkdir_destination ENOENT logs. Reproduce with %LOCALAPPDATA%\OpenAI\Codex pointing to a missing Junction target, then verify that initialization detects the invalid path and reports an actionable error or uses a valid runtime without entering the downstream browser and IPC failure state.

Written by the indexing model from the issue text.

Description

app bug windows-os

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.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.