windows sandbox: spawn setup refresh, fails several times on a new session or after /clear, and then it works

Resolved 💬 3 comments Opened May 5, 2026 by brunolm Closed May 5, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.128.0

What subscription do you have?

Pro

Which model were you using?

GPT 5.5

What platform is your computer?

Microsoft Windows NT 10.0.26220.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal (WSL / PowerShell)

What issue are you seeing?

First time

• Ran Get-Content -Path C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md
  └ execution error: Io(Custom { kind: Other, error: "windows sandbox: spawn setup refresh" })

  on to the PR data.

• Ran Get-Content -LiteralPath 'C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'
  └ execution error: Io(Custom { kind: Other, error: "windows sandbox: spawn setup refresh" })

• Ran Get-Location
  └ execution error: Io(Custom { kind: Other, error: "windows sandbox: spawn setup refresh" })

• Ran Get-Location
  └
    Path
    ----
    P:\bla\bla


• Ran Get-Content -LiteralPath 'C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'
  └ ---
    - Don't repeat the same finding across multiple files - call it out once and list the other locations.
• I’ve confirmed the review workflow. Next I’m pulling the PR metadata and file list so I can scope the review before
  reading the patch in detail.

• Running gh pr view [...]

After warmup it seems to work correctly, but it has to fail several times before it starts working as it should.

› read the brunolm-code-review skill file


• I’ll open the brunolm-code-review skill file from disk and keep its instructions in context.

• Ran Get-Content -LiteralPath 'C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'
  └ ---
    name: brunolm-code-review
    … +104 lines (ctrl + t to view transcript)

After doing a /clear

› read the brunolm-code-review skill file


• Using brunolm-code-review because you named it; I’m opening its SKILL.md now.

• Ran Get-Content -LiteralPath 'C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'
  └ execution error: Io(Custom { kind: Other, error: "windows sandbox: spawn setup refresh" })

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• The first read hit a sandbox startup error, so I’m retrying the same file read with an explicit PowerShell command.

• Ran & 'C:\Program Files\PowerShell\7\pwsh.exe' -NoLogo -NoProfile -Command "Get-Content -LiteralPath 'C:
  │ \BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'"
  └ execution error: Io(Custom { kind: Other, error: "windows sandbox: spawn setup refresh" })

• Ran Get-Content -LiteralPath 'C:\BrunoLM\Projects\dotfiles\common\.codex\skills\brunolm-code-review\SKILL.md'
  └ ---
    name: brunolm-code-review
    … +104 lines (ctrl + t to view transcript)
    - Don't invent issues to pad the list. A review with only nits is a fine review.
    - Don't repeat the same finding across multiple files - call it out once and list the other locations.

What steps can reproduce the bug?

  1. codex
  2. read file.md

What is the expected behavior?

command to execute successfully

Additional information

several errors before it succeeds a simple file read

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #19599

Powered by Codex Action

brunolm · 3 months ago

Solution

When moving codex.exe to another folder, you must also move codex-windows-sandbox-setup.exe and codex-command-runner.exe along with it.

sergeliatko · 3 months ago

Additional sanitized data point that may be related:

  • Codex CLI: 0.133.0
  • Platform/configuration: native Windows with elevated sandboxing enabled
  • User-visible failure: windows sandbox: spawn setup refresh
  • Impact: sandboxed PowerShell read commands failed before the process started
  • Local sandbox log root cause: codex-windows-sandbox-setup.exe failed to spawn with Windows OS error 740 (The requested operation requires elevation)
  • Installed helper location observed under vendor/x86_64-pc-windows-msvc/codex-resources
  • Older helper location under codex was absent

This occurred without manually moving codex.exe; the installed helper layout already appeared to be under codex-resources. Local workaround was to route project-local reads/searches through an IDE integration and use narrowly approved escalation only when exact shell behavior was required.