Environment
- Codex Desktop version:
26.721.41059 / 26.721.4979.0
- OS: Windows 11 / Windows 10 x64
- Install method: Microsoft Store / Standalone
Problem
In Settings > Configuration > Workspace dependencies, clicking Reinstall / Reset and install Workspace displays the error "Couldn't reinstall Codex dependencies" (settings.agent.dependencies.reset.failed).
Root Cause
Investigation of main-DS6zBDC3.js, agent-settings-CIjRkX96.js, and app-initial-BbEVL4-_.js shows two distinct failure points:
1. Path length limit during archive extraction
When clicking "Reinstall", the app runs aue.resetDependencies -> G0 -> nue, downloading the primary runtime archive and extracting it into %LOCALAPPDATA%\OpenAI\Codex\runtimes\.
Node and Electron use standard Windows filesystem APIs (fs.mkdir, fs.writeFile) without \\?\ UNC extended-length path prefixes. On Windows 10 and 11, LongPathsEnabled defaults to 0 in HKLM\SYSTEM\CurrentControlSet\Control\FileSystem, restricting paths to 260 characters (MAX_PATH).
The bundled .pnpm dependency tree includes deep paths such as:
C:\Users\<user>\AppData\Local\OpenAI\Codex\runtimes\Program Files\WindowsApps\OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0\app\resources\cua_node\bin\node_modules\@oai\sky\dist\node_modules\.pnpm\@rollup_plugin-typescript@12.1.2_rollup@4.35.0_tslib@2.8.1_typescript@5.7.3
This path is 264 characters long (> 260 character MAX_PATH). Windows returns [WinError 3] / ENOENT (The system cannot find the path specified) or Invalid argument. G0 catches the extraction error, sets the installer phase to error, and the UI displays "Couldn't reinstall Codex dependencies".
2. Feature gate check
Prior to downloading, aue.#e checks:
async #e(e) {
if (!n.pa({osRelease: d.default.release(), platform: process.platform}))
throw Error(n.Hn);
if (!await this.isWorkspaceDependenciesFeatureEnabled(e))
throw Error("Codex dependencies are disabled in settings.");
}
If workspace_dependencies is disabled in experimentalFeature/list or Statsig for the active account, isWorkspaceDependenciesFeatureEnabled returns false and #e throws Error("Codex dependencies are disabled in settings.") before any download occurs.
Workaround for Users
Enable Windows Long Paths in an administrative PowerShell session:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
Suggested Fix for Codex
- Format Windows target paths using
\\?\ UNC extended-length path prefixes during archive extraction in nue and G0.
- Display a specific UI toast when
isWorkspaceDependenciesFeatureEnabled fails due to server-side feature flags.
Environment
26.721.41059/26.721.4979.0Problem
In Settings > Configuration > Workspace dependencies, clicking Reinstall / Reset and install Workspace displays the error "Couldn't reinstall Codex dependencies" (
settings.agent.dependencies.reset.failed).Root Cause
Investigation of
main-DS6zBDC3.js,agent-settings-CIjRkX96.js, andapp-initial-BbEVL4-_.jsshows two distinct failure points:1. Path length limit during archive extraction
When clicking "Reinstall", the app runs
aue.resetDependencies->G0->nue, downloading the primary runtime archive and extracting it into%LOCALAPPDATA%\OpenAI\Codex\runtimes\.Node and Electron use standard Windows filesystem APIs (
fs.mkdir,fs.writeFile) without\\?\UNC extended-length path prefixes. On Windows 10 and 11,LongPathsEnableddefaults to0inHKLM\SYSTEM\CurrentControlSet\Control\FileSystem, restricting paths to 260 characters (MAX_PATH).The bundled
.pnpmdependency tree includes deep paths such as:C:\Users\<user>\AppData\Local\OpenAI\Codex\runtimes\Program Files\WindowsApps\OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0\app\resources\cua_node\bin\node_modules\@oai\sky\dist\node_modules\.pnpm\@rollup_plugin-typescript@12.1.2_rollup@4.35.0_tslib@2.8.1_typescript@5.7.3This path is 264 characters long (> 260 character
MAX_PATH). Windows returns[WinError 3] / ENOENT (The system cannot find the path specified)orInvalid argument.G0catches the extraction error, sets the installer phase toerror, and the UI displays "Couldn't reinstall Codex dependencies".2. Feature gate check
Prior to downloading,
aue.#echecks:If
workspace_dependenciesis disabled inexperimentalFeature/listor Statsig for the active account,isWorkspaceDependenciesFeatureEnabledreturns false and#ethrowsError("Codex dependencies are disabled in settings.")before any download occurs.Workaround for Users
Enable Windows Long Paths in an administrative PowerShell session:
Suggested Fix for Codex
\\?\UNC extended-length path prefixes during archive extraction innueandG0.isWorkspaceDependenciesFeatureEnabledfails due to server-side feature flags.