Windows sandbox instability: apply_patch intermittently fails with "windows sandbox: setup refresh failed with status exit code: 1"

Open 💬 1 comment Opened Apr 3, 2026 by Yi-Long-Zhang

What version of the Codex App are you using (From “About Codex” dialog)?

26.325.31654

What subscription do you have?

plus

What platform is your computer?

Windows11

What issue are you seeing?

On Windows, file operations via PowerShell in the same workspace are stable, but Codex built-in apply_patch is intermittently failing.
Main error:
windows sandbox: setup refresh failed with status exit code: 1

Observed behavior:
1) apply_patch Add File sometimes succeeds, but Update/Delete often fails with the sandbox refresh error.
2) In some runs, even Add File fails immediately with the same error.
3) PowerShell create/write/read/delete in the same deep directories works normally.
4) This blocks normal coding workflows because built-in patching is unreliable.

What steps can reproduce the bug?

1) Open Codex App on Windows in workspace D:\Code\GolandProjects\tdem.
2) Use apply_patch to Add File: src/sandbox-tool/deep/probe.txt.
3) Use apply_patch to Update File on the same file.
4) Use apply_patch to Delete File on the same file.
5) In parallel, run PowerShell create/read/delete under src/ as control.
6) Compare results: PowerShell succeeds, apply_patch fails intermittently with sandbox refresh error.

What is the expected behavior?

apply_patch should consistently support Add/Update/Delete inside writable workspace paths, with behavior matching stable shell file operations in the same session.

Additional information

  • Workspace: D:\Code\GolandProjects\tdem
  • Shell: PowerShell
  • Date observed: 2026-04-03
  • I also saw one update mismatch when file had UTF-8 BOM, but the main blocker is the recurring sandbox refresh failure.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗