Skip to content

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

Open

Description

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

Activity

  1. added
    appIssues related to the Codex desktop app
    on Apr 3, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    tool-callsIssues related to tool calling
    on Apr 3, 2026
  3. removed
    appIssues related to the Codex desktop app
    on Apr 3, 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

    bugSomething isn't workingsandboxIssues related to permissions or sandboxingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions