codex - 💡(How to fix) Fix windows sandbox: spawn setup refresh, fails several times on a new session or after /clear, and then it works [2 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#21208Fetched 2026-05-06 06:24:52
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2closed ×1

Error Message

• 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 [...]

Root Cause

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

Fix Action

Fix / Workaround

• 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.

Code Example

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 [...]

---

› 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)

---

› 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.
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

The issue can be mitigated by retrying the file read operation after an initial failure, as the error seems to resolve itself after several attempts.

Guidance

  • The error message "windows sandbox: spawn setup refresh" suggests an issue with the Windows sandbox environment, which may be causing the initial failures.
  • Retrying the file read operation using the same command, as shown in the issue, can help resolve the issue after several attempts.
  • Using an explicit PowerShell command to read the file, as shown in the issue, may also help resolve the issue after an initial failure.
  • The fact that the issue resolves itself after several attempts suggests a potential issue with the sandbox setup or initialization process.

Example

No code snippet is provided as the issue seems to be related to the Windows sandbox environment and the Codex CLI, and not a specific code issue.

Notes

The root cause of the issue is unclear, but it seems to be related to the Windows sandbox environment and the Codex CLI. The fact that the issue resolves itself after several attempts suggests a potential issue with the sandbox setup or initialization process.

Recommendation

Apply workaround: retry the file read operation after an initial failure, as this seems to resolve the issue in most cases.

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 windows sandbox: spawn setup refresh, fails several times on a new session or after /clear, and then it works [2 comments, 2 participants]