Skip to content

Windows sandbox initialization fails with “setup refresh had errors” #50007

Open

Description

@wbdb

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

26.928.31416

What subscription do you have?

Business Premium

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Local commands failed before execution in Codex Desktop on Windows using PowerShell with the workspace-write sandbox.

Even a read-only command such as Get-Content public/css/admin.css failed with:

CreateProcess {
message: "Rejected("Failed to create unified exec process: helper_unknown_error: setup refresh had errors")"
}

Retrying with login: false produced the same error. The Node REPL also failed to start and reported:

windows sandbox failed: helper_unknown_error: setup refresh had errors

Its kernel exited with code 1.

Running commands with sandbox_permissions: "require_escalated" succeeded afterward, allowing the task to continue. This suggests the failure occurred during sandbox initialization rather than in the command itself.

Expected behavior: Ordinary read and write operations inside the authorized workspace should run without requiring escalation.

What steps can reproduce the bug?

  1. Start with a workspace where .agents does not exist yet.
  2. Launch Codex with the elevated Windows sandbox enabled.
  3. During the initial ACL refresh, .agents is skipped because the directory does not exist yet.
  4. Trigger creation of .agents from inside the sandbox.
  5. The newly created .agents directory may then be owned by the sandbox account, for example CodexSandboxOffline.
  6. Trigger another sandbox setup or ACL refresh, e.g. by starting another command or session.
  7. Codex now detects .agents and tries to apply its protective DENY ACE.
  8. The refresh fails because the normal Windows user is not the owner of .agents and cannot update its ACL.

Resulting error:

deny ACE failed on <workspace>\.agents: open deny ACL target for update
setup refresh completed with errors
setup error: setup refresh had errors

This would explain why the issue does not occur consistently: it depends on whether .agents already exists before the first sandbox refresh and which account creates it.

If .agents already exists and is owned by the normal Windows user, the problem does not seem to occur.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    app
    on Oct 1, 2026
  2. added
    bug
    windows-os
    sandbox
    on Oct 1, 2026
  3. wbdb commented on Oct 1, 2026

    @wbdb
    Author

    @chess-oai Another windows sandbox issue

    Seems related: #43776

    deny ACE failed on ....agents: open deny ACL target for update
    setup refresh completed with errors

    Temporary workaround PowerShell:

    $me = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
    icacls "C:\wamp64\www\xyz\.agents" /setowner "$me"
    
  4. chess-oai commented on Oct 5, 2026

    @chess-oai
    Contributor

    @wbdb fix for this is also in-flight

  5. sergio-r-f-oliveira commented on Oct 7, 2026

    @sergio-r-f-oliveira

    Additional Windows case with a validated fallback workaround.

    Environment:

    • Windows 11 Enterprise 23H2, build 22631.7584, x64
    • OpenAI.Codex Windows package 26.1002.7124.0
    • Bundled codex-cli 0.162.0-alpha.2
    • Package status: Ok
    • ChatGPT.exe, codex.exe, node.exe, and node_repl.exe all have valid OpenAI signatures

    Observed behavior:

    • With the elevated Windows sandbox path, even minimal local PowerShell commands failed before execution.
    • Error: Failed to create unified exec process: helper_unknown_error: setup refresh had errors
    • The same failure occurred for commands such as Get-Date.
    • Restarting the desktop app and using Windows App Repair did not resolve the execution failure.

    Validated workaround:

    1. Set the user config to:
      [windows]
      sandbox = "unelevated"
    2. Launch the desktop app with --disable-gpu.
    3. Start a new chat and run Get-Date.

    Result:

    • Get-Date executed successfully and returned the local date/time.
    • Subsequent local PowerShell execution also succeeded.
    • Start menu and taskbar shortcuts were configured with --disable-gpu.

    The two changes may address separate problems: sandbox = "unelevated" appears to bypass the elevated sandbox setup/refresh failure, while --disable-gpu appears to prevent the desktop UI from closing or hanging during setup. The unelevated sandbox is understood to provide weaker isolation, so this is being treated as a temporary compatibility workaround with approval prompts kept enabled.

    No credentials, private project files, or session logs are included in this comment.

  6. larshp commented on Oct 8, 2026

    @larshp

    thanks, changing the config to unelevated helped me getting the vscode codex extension working again

  7. clijun555-a11y commented on Oct 8, 2026

    @clijun555-a11y

    Additional reproduction from a Windows Codex desktop session on 2026-10-09 (Asia/Shanghai), posted with the affected user's authorization.

    Observed failure

    Even the read-only PowerShell command Get-Location fails before the command starts:

    exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")" }
    

    This was reproduced repeatedly, including with login: false. Reading a local skill file fails with the same error. An attempted file creation via apply_patch also failed. The alternative Node REPL repeatedly returned:

    trusted Node process exited unexpectedly; kernel reset, rerun your request
    

    Permission test

    The session used a workspace-write sandbox. The user explicitly granted additional network access and write access to the intended project and skill-install directories through the permission request tool. Retrying after those grants still produced the identical process-creation error. We did not establish that any UI access-mode setting was being ignored.

    External terminal control test and impact

    In an external Windows PowerShell, the user successfully installed Remotion skills and project dependencies, started Remotion Studio, downloaded Chrome Headless Shell, and rendered/encoded a 1920x1080, 30 FPS, 5-second H.264 MP4. This required manually copying the agent's script into the external terminal because the agent could not read or write the project or launch commands itself. The render completed successfully while the agent execution failure persisted.

    A separate external PowerShell restriction on npx.ps1 was resolved by using npx.cmd; that issue should not be conflated with the Codex helper failure, which occurs even for Get-Location.

    Expected behavior

    Permitted workspace commands and file operations should run without requiring the user to manually relay scripts through an external terminal. If environment setup fails, the error should identify the failing setup step and a supported recovery action.

    The user suspects a recent update regression, but we have not verified a before/after version comparison. The installed app version and detailed sandbox/ACL logs were not obtained, and this reproduction does not establish the ACL root cause discussed in the original report. Personal paths and screenshots are intentionally omitted.

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

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions