codex - 💡(How to fix) Fix Native Windows Codex app: workspace dependency repair fails; npx/tsx and esbuild hit EPERM in sandbox [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18861Fetched 2026-04-22 07:51:18
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×3mentioned ×1unlabeled ×1

Error Message

  • Error: EPERM: operation not permitted, lstat 'C:\Users\andre'
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

The installed Codex app build visible in this session is OpenAI.Codex_26.415.1938.0_x64, so the app version appears to be 26.415.1938.0.

What subscription do you have?

Business plan monthly

What platform is your computer?

Windows 10 x64

What issue are you seeing?

Feedback/session ID: d16ff2fe-4cf9-4bf2-8a8c-ebb4ecbad680

Additional context: this machine is on an out-of-support Windows 10 build and Windows Update reports it is missing important security and quality fixes, so this may be interacting with the native Windows sandbox/runtime.

I’m seeing what looks like a native Windows Codex app sandbox/runtime issue rather than a repo-specific failure.

Environment

  • Codex app on Windows
  • Sandbox mode: workspace-write
  • Approval policy: never
  • Network: enabled
  • Working directory: C:\AspenMetrics2\receiptcheck-engine

What happened

  • “Reset and install workspace” failed
  • “Diagnose issues in Codex Workspace” says: “codex dependencies may need repair, send feedback if this keeps happening”
  • Codex can run basic Node commands, but fails on npx/tsx and esbuild paths with EPERM

Repro These work:

  • node -v
  • node -e "console.log('ok')"
  • node -e "require('child_process').spawnSync(process.execPath,['-e','console.log(123)'],{stdio:'inherit'})"

This fails before tsx starts:

  • npx tsx --version
  • Error: EPERM: operation not permitted, lstat 'C:\Users\andre'

These work:

  • .\node_modules.bin\tsx.cmd --version
  • node .\node_modules\tsx\dist\cli.mjs --version

esbuild repro:

  • node -e "console.log(require('esbuild').version)" works
  • node -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'})" fails with spawn EPERM

Direct binary execution from PowerShell works:

  • .\node_modules@esbuild\win32-x64\esbuild.exe --version

But Node cannot spawn that same binary:

  • spawnSync('.\node_modules\@esbuild\win32-x64\esbuild.exe',['--version'])
  • result: EPERM

Additional signal

  • fs.realpathSync('C:\Users\andre') returns EPERM
  • This suggests the sandbox is blocking access to that path
  • Node child-process spawning appears to fail in the mode esbuild relies on

Why this seems like a Codex/runtime issue

  • Basic Node execution works
  • Repo-local tsx works
  • PowerShell can execute the esbuild binary directly
  • The failure appears at sandboxed path access and child-process spawn behavior

Questions

  1. Is this a known issue with the native Windows Codex app sandbox?
  2. Is there a recommended fix or config change?
  3. My app UI does not appear to show the documented Windows-native vs WSL agent switch. Is that expected for some builds?

What steps can reproduce the bug?

Session ID: d16ff2fe-4cf9-4bf2-8a8c-ebb4ecbad680

Bug summary: On the native Windows Codex app, the workspace dependency repair/install path appears broken, and Node-based toolchains that rely on certain sandboxed filesystem and child-process behavior fail with EPERM. Basic Node execution works, but npx tsx fails before startup with an lstat EPERM against C:\Users\andre, and esbuild fails with spawn EPERM when invoked through Node. Direct execution of the same local binaries from PowerShell works, which suggests this is a Codex native Windows sandbox/runtime issue rather than a repo-specific dependency failure.

Environment:

  • Codex app on Windows
  • Sandbox mode: workspace-write
  • Approval policy: never
  • Network: enabled
  • Working directory: C:\AspenMetrics2\receiptcheck-engine

Observed behavior:

  • “Reset and install workspace” failed
  • “Diagnose issues in Codex Workspace” says: “codex dependencies may need repair, send feedback if this keeps happening”
  • npx tsx --version fails with EPERM: operation not permitted, lstat 'C:\Users\andre'
  • node -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'})" fails with spawn EPERM

Expected behavior:

  • Workspace dependency repair/install should complete successfully
  • npx tsx --version should run normally
  • esbuild should be spawnable from Node inside the Codex environment

Minimal repro snippets:

  1. Repro the blocked path access:
node -e "require('fs').realpathSync('C:\\Users\\andre')"

### What is the expected behavior?

_No response_

### Additional information

_No response_

extent analysis

TL;DR

The issue is likely due to the native Windows Codex app sandbox blocking access to certain paths, causing npx and esbuild to fail with EPERM errors, and can be mitigated by adjusting the sandbox mode or approval policy.

Guidance

  • Verify that the issue is indeed related to the sandbox mode by trying to run the same commands in a different sandbox mode, such as workspace-read or disabled.
  • Check the approval policy settings to ensure that it is not blocking the necessary paths or child-process spawning.
  • Try running the commands using the --workspace-write flag to see if it makes a difference.
  • Consider updating the Windows 10 build to a supported version, as the current build may be missing important security and quality fixes that could be contributing to the issue.

Example

No code snippet is provided as the issue seems to be related to the Codex app configuration and sandbox mode rather than a specific code problem.

Notes

The issue may be specific to the native Windows Codex app and the workspace-write sandbox mode. The fact that basic Node execution works and repo-local tsx works suggests that the issue is related to the sandboxed filesystem and child-process behavior.

Recommendation

Apply a workaround by adjusting the sandbox mode or approval policy, as the root cause of the issue is likely related to the Codex app configuration rather than a specific code problem. This may involve changing the sandbox mode to workspace-read or disabled, or updating the approval policy settings to allow the necessary paths and child-process spawning.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Native Windows Codex app: workspace dependency repair fails; npx/tsx and esbuild hit EPERM in sandbox [3 comments, 2 participants]