Skip to content

Windows sandbox repeatedly fails with helper_unknown_error: setup refresh had errors #42513

Open

Description

@xxryze

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

26.901.20858

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex repeatedly fails before it can read or edit repository files with:

windows sandbox failed:
helper_unknown_error: setup refresh had errors

This has happened at least 4 consecutive times.

The problem occurred both in a long-running Codex task and again after creating a completely new task with clean context.

A normal sandbox execution failed before reading the target files. I then explicitly authorized a single elevated apply_patch containing the complete patch payload and only the five approved paths, but that also failed before reading the first file with the same helper/setup refresh error.

No repository changes were applied.

What steps can reproduce the bug?

Feedback ID: 01a066fa-e20c-7c50-b66a-1c0f0bdbb9a9

What is the expected behavior?

Codex should initialize the Windows sandbox successfully, read the authorized local repository files, apply the requested scoped edits, and allow subsequent diff validation without failing during sandbox/helper setup.

Additional information

The failure appears to occur before repository command execution, not because of the repository contents.

Starting a new Codex task did not resolve it.

An explicitly authorized elevated apply_patch also failed before reading the first target file.

I avoided trying additional write mechanisms to prevent unintended repository modifications.

The ChatGPT feedback report above includes diagnostic/browser logs.
Reproduction details:

  1. Open Codex on Windows.
  2. Open a local repository task.
  3. Ask Codex to read/edit a small explicitly scoped set of files.
  4. Codex attempts to use the Windows sandbox.
  5. Execution fails with:
    helper_unknown_error: setup refresh had errors
  6. Retry in a brand-new Codex task.
  7. The same failure occurs again before the target file is read.

This has reproduced at least 4 consecutive times.

The issue occurred both in a long-running Codex task and in a newly created clean task.

An explicitly authorized elevated apply_patch also failed before reading the first target file.

No repository changes were applied.

The failure appears to occur during Windows sandbox/helper initialization, before repository command execution.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Sep 3, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Sep 3, 2026
  3. playdiplomatica commented on Sep 4, 2026

    @playdiplomatica

    @xxryze Is it failing in a git repo on your PC? If so, check if the Codex sandbox owns the .git directory. If it does, that could be the problem.

    You can run this since you're on Windows:

    (Get-Acl ".git").Owner

    in the directory of the project.

    If it returns something like:

    [DEVICE_NAME]\CodexSandboxOffline

    then that's the issue. To fix it you would then just have to set the ownership back to you by running:

    takeown /F .git /R /D Y
    icacls .git /setowner "[DEVICE_NAME_HERE]\[WINDOWS_USER_HERE]" /T /C

    and then verify if it worked by running this again:

    (Get-Acl ".git").Owner

    which should then return:

    [DEVICE_NAME]\[WINDOWS_USER]
  4. playdiplomatica commented on Sep 4, 2026

    @playdiplomatica

    If icacls or takedown fails, don't force the issue. You can then just paste the output of the terminal in ChatGPT and it'll diagnose the issue further.

  5. shapeh commented on Sep 7, 2026

    @shapeh

    I have the same issue and codex sandbox does NOT own my .git - my local windows user does. I still have the error (ref #43416) and I am on 26.901.51231 and Pro.

  6. acdole commented on Sep 15, 2026

    @acdole

    I’m seeing a very similar issue on Codex Desktop / Windows 11 with a WSL2 Ubuntu 24.04 workspace.

    Feedback ID: 01a08f14-28f3-7410-a847-e543c75d34bd

    Environment:

    • ChatGPT Plus
    • Windows 11
    • Codex Desktop
    • WSL2 Ubuntu 24.04
    • Native WSL workspace under /home/...
    • Reproduced on GPT-5.6 Sol Light and Terra Light

    Symptoms include:

    • repeated execution/runtime termination after ~30 sec–3 min despite substantial visible 5-hour/weekly allowance remaining;
    • helper_unknown_error: setup refresh had errors;
    • trivial WSL commands rejected before WSL receives them;
    • SyntaxError: Invalid or unexpected token;
    • execution-wrapper failures involving missing TextEncoder;
    • occasional worker stalls where Codex remains responsive to status requests but no tool execution proceeds.

    Local WSL itself is healthy. Commands such as id and docker ps work when they actually reach WSL, and the repository/Docker environment is otherwise functional.

    One readiness sequence demonstrated the problem clearly:

    1. docker ps succeeded.
    2. The next simple command, cd /home/... && git status --short, was rejected by the Codex execution layer before WSL received it.

    This appears to be a Codex Desktop/Work execution or sandbox/command-dispatch issue rather than a repository, Git, Docker, WSL, or account-usage issue.

    I’ve submitted diagnostics/screenshots under the Feedback ID above and can provide additional examples if useful.

    Related WSL-specific behavior appears similar to #35380 and #25280.

  7. Freemlen commented on Sep 19, 2026

    @Freemlen

    Related investigation: #43373.

    A controlled Windows reproduction reached the same pre-command setup refresh had errors boundary. The key practical result was that sandbox initialization could fail on the normal user Temp path before any requested tool logic executed; using a process-scoped dedicated TEMP/TMP restored the trusted runtime on that machine.

    The later RCA also showed that SetNamedSecurityInfoW(...)=5 is an aggregate recursive ACL result and does not necessarily mean a root security write itself failed. This may be useful when interpreting sandbox logs for this issue.

  8. kakabanga commented on Sep 28, 2026

    @kakabanga

    Same error here, with a variant that may help isolate the cause: the failure is intermittent and self-clearing on retry, not persistent.

    Environment: Codex CLI 0.155.1, Windows 11 (10.0.26200.9457), sandbox_mode = "workspace-write", [windows] sandbox = "elevated", workspace on D: drive (not under user profile).

    What happens:
    The first shell command of a session sometimes fails with:

    Failed to create unified exec process: helper_unknown_error: setup refresh had errors
    

    Retrying the same command succeeds, and later commands in the session work normally.

    Sandbox log observations (%USERPROFILE%\.codex\.sandbox\):

    • Recent setup refresh runs report processed 3 write roots (read roots delegated); errors=[].
    • The only recurring failure logged is:
      hide users: failed to hide current user profile dir (C:\Users\Default): SetFileAttributesW failed for C:\Users\Default: 5 (Access is denied.)
      
    • The helper version in the log (codex-command-runner-0.153.4.exe) differs from the CLI version (0.155.1) - a helper-vs-CLI version mismatch.

    Why this might matter:
    The top-level error gives no underlying Win32 error, so it is hard to tell whether the transient failure is caused by the C:\Users\Default access denial, a race in setup refresh, or something else. The C:\Users\Default directory requires elevated permissions to modify attributes; if the hide-users step is sometimes fatal to the refresh and sometimes not, that could explain the intermittency.

    Ask:

    1. Surface the underlying Win32 error in helper_unknown_error so transient vs persistent failures can be distinguished.
    2. Treat the C:\Users\Default hide-users access denial as non-fatal if it is currently contributing to the refresh failure.
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

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-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