Native Windows Codex app: workspace dependency repair fails; npx/tsx and esbuild hit EPERM in sandbox
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
- Is this a known issue with the native Windows Codex app sandbox?
- Is there a recommended fix or config change?
- 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 --versionfails withEPERM: operation not permitted, lstat 'C:\Users\andre'node -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'})"fails withspawn EPERM
Expected behavior:
- Workspace dependency repair/install should complete successfully
npx tsx --versionshould 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_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks — I reviewed the suggested duplicates.
My issue seems closest to:
workspace-writefails whiledanger-full-accessworks / PowerShell path behavior)However, my repro is specifically:
npx tsx --version->EPERM: operation not permitted, lstat 'C:\Users\andre'node -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'})"->spawn EPERMReset and install workspacefailedDiagnose issues in Codex Workspacesays dependencies may need repairSo I’m leaving this open for now unless maintainers think one of the linked issues already fully covers this exact native Windows repro.
I did a narrower environment diagnosis inside Codex Desktop on native Windows + PowerShell, and the failure looks more specific than a repo bug.
Environment from this session:
OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0workspace-writeneverC:\AspenMetrics2\receiptcheck-engineWhat works:
node -v->v20.18.0where.exe node-> resolves to bothC:\nvm4w\nodejs\node.exeand the app-bundled Nodenode -e "console.log('ok')"-> printsoknode -e "require('child_process').spawnSync(process.execPath,['-e','console.log(123)'],{stdio:'inherit'})"-> works, prints123.\node_modules\.bin\tsx.cmd --version-> works, prints:tsx v4.21.0node v20.18.0node .\node_modules\tsx\dist\cli.mjs --version-> also works.\node_modules\@esbuild\win32-x64\esbuild.exe --version->0.27.4What fails:
npx tsx --versionfails beforetsxstarts with:Error: EPERM: operation not permitted, lstat 'C:\Users\andre'fs.realpathSync('C:\\Users\\andre')->EPERMnode -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'}); console.log('transform-ok')"fails with:Error: spawn EPERMensureServiceIsRunninginnode_modules\esbuild\lib\main.jsspawnSync('.\\node_modules\\@esbuild\\win32-x64\\esbuild.exe',['--version'])->EPERMImportant nuance:
spawnSync(process.execPath, ..., {stdio:'inherit'})spawnSync(process.execPath, ..., default stdio)->EPERMspawn(...)with piped stdio ->EPERMMy reading of this:
C:\Users\andre, but access to them is denied (lstat/realpathSync->EPERM)esbuild(and likely other tools using piped stdio / IPC)That combination explains why:
nodeworkstsxversion check can worknpxcan fail on home-path accessesbuild-backed execution fails withspawn EPERMIf useful, I can provide the exact command transcripts, but the shortest reliable repro on this machine is:
node -e "require('esbuild').transformSync('const x: number = 1',{loader:'ts'}); console.log('transform-ok')"Error: spawn EPERMand separately:
npx tsx --versionEPERM: operation not permitted, lstat 'C:\Users\andre'我也遇到了这个问题
I am seeing the same native Windows Codex desktop dependency repair issue.
Environment:
Symptoms:
Why I think this may be the same native Windows sandbox/runtime bug:
Question:
Is the recommended workaround currently to reset %APPDATA%\Codex, switch to WSL2 mode, change the Windows sandbox configuration, or wait for a Codex desktop app fix?