Skip to content

[Windows] Workspace dependency reinstall fails on 260-character MAX_PATH extraction limit #36768

Description

@Happyalex1122

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

  1. Format Windows target paths using \\?\ UNC extended-length path prefixes during archive extraction in nue and G0.
  2. Display a specific UI toast when isWorkspaceDependenciesFeatureEnabled fails due to server-side feature flags.

Activity

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

    appIssues related to the Codex desktop appbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions