Skip to content

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

Closed

Description

@liviuolos

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';

Activity

  1. tibo-openai commented on Apr 17, 2025

    @tibo-openai
    Collaborator

    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!

  2. added
    bug
    on Apr 17, 2025
  3. tibo-openai commented on Apr 17, 2025

    @tibo-openai
    Collaborator
  4. LuSrodri commented on Apr 18, 2025

    @LuSrodri

    Thanks @tibo-openai @liviuolos @ymichael !

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

  5. added a commit that references this issue on Jul 19, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions