windows sandbox: setup refresh failed exit code: 1

Open 💬 1 comment Opened Apr 8, 2026 by Faker-Lost

What version of the IDE extension are you using?

26.325.31654

What subscription do you have?

PLUS

Which IDE are you using?

VS Code 1.114.0

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Issue:
apply_patch fails in the current Codex window on Windows before the patch is applied.

Platform:
Microsoft Windows NT 10.0.26200.0 x64

What I was trying to do:
I was testing whether apply_patch works in the current session with a minimal probe patch that only creates a temporary file.

Prompt:
“Check whether apply_patch can run successfully in the current window.”

ERROR:
execution error: Io(Custom { kind: Other, error: "windows sandbox: setup refresh failed with status exit code: 1" })

Minimal patch used:
* Begin Patch
* Add File: tmp/apply_patch_probe.txt
+apply_patch probe
*** End Patch

Actual result:
The patch did not run. No file was created and no business code was modified.

Full error message:
execution error: Io(Custom { kind: Other, error: "windows sandbox: setup refresh failed with status exit code: 1" })

Expected result:
apply_patch should apply the minimal patch successfully, or at least fail with a patch-validation error if the patch content is invalid. Instead, it fails during sandbox setup before patch execution starts.

Notes:

  • This appears to be an environment/tooling issue rather than a patch syntax issue.
  • The failure happens before any file write occurs.
  • Other tools such as shell-based file reads/writes are working in the same session.

What steps can reproduce the bug?

Steps to reproduce:

  1. Open a Codex session on Windows.
  2. In the current workspace, run a minimal apply_patch action that should only create a temporary file.
  3. Use the following minimal patch:

* Begin Patch
* Add File: tmp/apply_patch_probe.txt
+apply_patch probe
*** End Patch

  1. Observe that apply_patch fails before the patch is applied.
  2. Verify that the file tmp/apply_patch_probe.txt was not created.

Reproducible bug:
apply_patch fails in the current Windows session during sandbox setup, before patch execution begins.

Actual error:
execution error: Io(Custom { kind: Other, error: "windows sandbox: setup refresh failed with status exit code: 1" })

Expected behavior:
The patch should create tmp/apply_patch_probe.txt, or at minimum fail with a patch validation error if the patch syntax is invalid.

Minimal reproduction snippet:
* Begin Patch
* Add File: tmp/apply_patch_probe.txt
+apply_patch probe
*** End Patch

Verification command:
PowerShell:
if (Test-Path 'tmp\\apply_patch_probe.txt') { Write-Output 'EXISTS' } else { Write-Output 'MISSING' }

Observed verification result:
MISSING

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

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