codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows: codex CLI crashes on ls -R . & sandbox initialization failure

Open liviuolos opened this issue 1 year ago • 3 comments

Environment:

OS: Windows 10/11 (PowerShell)

Node.js: v22.14.0

Codex CLI: v0.1.2504161551 (model: o4‑mini)

CWD: C:\Users<USERNAME>\…\test1

🐛 Steps to Reproduce Open a PowerShell prompt in your project folder.

Run codex.

At the codex> prompt, enter:

powershell Copy Edit ls -R . 🤔 What Happens Error: spawn ls ENOENT The tool attempts to execute ls, which isn’t available on Windows.

Sandbox error:

vbnet Copy Edit Error: Sandbox was mandated, but no sandbox is available! at Q3e (cli.js:439:254) The mandatory sandbox step then crashes the process.

Three.js warnings & errors (from my project code):

THREE.OrbitControls is not a constructor

Deprecation: build/three.min.js removed in r160 (r150+ warn).

✅ Expected Behavior Fall back to a Windows‐compatible directory listing (e.g. dir) or use Node’s fs.readdir.

If sandbox can’t be initialized, continue in “no‑sandbox” mode rather than exit.

Example snippets should load OrbitControls via ES Module path:

js Copy Edit import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; 💡 Suggested Fixes Cross‑Platform ls Replacement Detect OS and run dir on Windows, or use fs.readdir internally.

Sandbox Fallback Make sandbox optional or provide a no‑sandbox flag so the CLI remains usable.

Three.js Module Imports Update docs and examples to use ES Modules (r150+), e.g.:

js Copy Edit import * as THREE from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';

liviuolos avatar Apr 17 '25 16:04 liviuolos

We should detect the platform and return a friendly error on windows that sandboxing / full-auto isn't supported. Will accept a PR with a fix!

tibo-openai avatar Apr 17 '25 16:04 tibo-openai

Fixed by https://github.com/ymichael/open-codex/commit/e26ccb3c3b7cb7ffe0370f73bb83e59b15d23c1e

tibo-openai avatar Apr 17 '25 21:04 tibo-openai

Thanks @tibo-openai @liviuolos @ymichael !

Someone knows where I can read more about the Codex environments compatibility? I am fail in found this...

LuSrodri avatar Apr 18 '25 16:04 LuSrodri