Skip to content

Windows workspace dependency runtime reinstall creates Node-unusable pnpm directory links #22038

@1gaojer

Description

@1gaojer

What happened?

On Windows, Codex Desktop's Reset and install Workspace / workspace dependency reinstall can report success and make load_workspace_dependencies see the bundled runtime, but the installed Node workspace dependencies are not actually usable.

After reinstalling the bundled runtime, Node fails to resolve packages inside the bundled node_modules tree because at least some pnpm directory links exist on disk but cannot be stat'ed/followed by Node.

The concrete failure I observed was:

Cannot find module 'setimmediate'
require stack: pptxgenjs -> jszip -> setimmediate

Inspecting the installed runtime showed the package link exists:

...\dependencies\node\node_modules\.pnpm\jszip@3.10.1\node_modules\setimmediate
LinkType: SymbolicLink
Target: ..\..\setimmediate@1.0.5\node_modules\setimmediate
PowerShell Test-Path ...\setimmediate\package.json => True

But Node cannot stat/follow it:

EPERM: operation not permitted, stat '...\.pnpm\jszip@3.10.1\node_modules\setimmediate'

Environment

  • OS: Windows
  • Codex Desktop workspace dependency bundle: 26.506.11943
  • Runtime path: %USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime
  • Node in bundle: v24.14.0
  • Python in bundle: Python 3.12.13
  • Windows Developer Mode was enabled before the reinstall

Reproduction / diagnosis notes

  1. Use Codex Desktop on Windows.
  2. Enable workspace dependencies.
  3. Click Reset and install Workspace.
  4. The UI can report the reinstall succeeded.
  5. load_workspace_dependencies reports the bundle paths correctly.
  6. Running bundled Node with the bundled node_modules path and importing packages such as pptxgenjs fails because Node cannot follow a pnpm-linked dependency directory.

Before enabling Developer Mode, the same reinstall path also failed during extraction with many archive extraction errors like:

Failed to extract primary runtime archive
Can't create '\\?\C:\Users\...\.cache\codex-runtimes\codex-runtime-install-...\payload\codex-primary-runtime\dependencies\node\node_modules\...' : Invalid argument

After enabling Developer Mode, extraction appears to complete, but the runtime still contains directory symlinks that are unusable by Node in this environment.

Workaround that fixed it locally

Manually reinstalling the runtime while materializing pnpm directory links as Windows junctions fixed the issue. After that, these checks passed:

node.exe --version => v24.14.0
python.exe --version => Python 3.12.13
require('docx') => OK
require('pptxgenjs') => OK
require('sharp') => OK
import docx, openpyxl, artifact_tool_v2 => OK

Clicking Reset and install Workspace again deletes that repaired bundle and reintroduces the broken official install state.

Expected behavior

The Windows workspace dependency installer should produce a runtime where bundled Node packages can be resolved and imported by Node after reinstall.

Possible fixes might include creating Windows directory junctions for pnpm directory links, creating directory symlinks in a way Node can follow, or materializing the linked directories during extraction on Windows.

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions