You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Workspace terminal fails to start with "setup refresh had errors" #39841
appIssues related to the Codex desktop appbugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.31338
What subscription do you have?
Plus
What platform is your computer?
Windows 11 x64
What issue are you seeing?
The workspace terminal cannot start any command.
Whenever I run a terminal command such as pwd, Get-Location, or rg --files, the command fails before execution with the following error:
CreateProcess:
Rejected("Failed to create unified exec process: helper_unknown_error: setup refresh had errors")
The issue occurs with PowerShell, Command Prompt, and the system PowerShell executable. No detailed stack trace, log path, or additional information about the "setup refresh" failure is shown.
I can reproduce the same problem in Codex Desktop on Windows.
Every local command fails before execution, including:
Get-Location
Get-Content -Raw <file>
The exact error is:
CreateProcess {
message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")"
}
I also tried switching from the bundled PowerShell runtime to the system Windows PowerShell; the failure is unchanged. Restarting/reinstalling the Codex desktop app did not resolve it.
Additional reproduction after restarting Codex Desktop on 2026-08-24:
Workspace: C:\___Projects\openai-api
Restarting Codex Desktop did not resolve the failure.
I explicitly requested Git Bash instead of PowerShell.
Attempts used:
C:\Program Files\Git\bin\bash.exe
bash
the bundled runtime path ending in dependencies\native\git\bin\bash.exe
Even with the explicit Git Bash shell selection, the execution result showed a cmd.exe /c wrapper and failed before Bash started.
A minimal command such as pwd; git --version never executed.
The exact failure remained: CreateProcess { message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")" }
This means a full app restart and selecting an alternative shell do not provide a workaround. The failure occurs before the requested shell process starts. No repository files were modified.
I can reproduce this error on app version 26.819.11345 on windows 11 x64
Reproducible with; Get-Date -Format o (or any powershell command)
helper_unknown_error: setup refresh had errors
Persists after reinstall and restart
Additional reproduction from Codex Desktop on Windows on 2026-08-25:
Workspace root: C:\___Projects
Every local process launch failed before command execution with helper_unknown_error: setup refresh had errors.
Explicit shell selection using both C:\Program Files\Git\bin\bash.exe and C:\Program Files\Git\usr\bin\bash.exe did not start Git Bash; the execution result instead showed a cmd.exe /c wrapper and failed during setup.
Directly invoking C:\Program Files\Git\bin\bash.exe from the bundled PowerShell runtime also failed before Bash started.
Minimal commands such as pwd never executed.
The task had no attached app terminal session, so that path could not be used as a fallback.
No workspace or repository files were created or modified.
This confirms the failure persists across another local workspace and blocks explicit alternative-shell selection as well as direct shell invocation.
Confirmed fix for my instance of this issue on Windows.
The displayed error was:
Rejected("Failed to create unified exec process:
helper_unknown_error: setup refresh had errors")
The specific cause was recorded in:
%USERPROFILE%\.codex\.sandbox\sandbox.<date>.log
My log contained:
deny ACE failed on C:\path\to\repo\.git:
SetNamedSecurityInfoW failed: 5
Checking the directory showed that .git was incorrectly owned by CodexSandboxOffline:
(Get-Acl"C:\path\to\repo\.git").Owner
I opened PowerShell as Administrator and restored ownership of only that directory:
takeown /F "C:\path\to\repo\.git"
After restarting Codex:
.git was owned by my Windows account;
sandbox setup reported errors=[];
normal terminal commands executed successfully again.
This fix is path-specific. Other instances of setup refresh had errors may involve Temp, WindowsApps, WSL/UNC paths, or another workspace directory. Check the current sandbox log for the exact failing path before changing ownership or permissions. Recursive ACL changes should not be necessary unless the log explicitly identifies child paths.
I can reproduce this on Codex Desktop 26.820.7780.0 on Windows x64 in a local workspace. On 2026-08-26 (Europe/Warsaw), Browser startup via node_repl fails before browser selection. The Node kernel exits with code 1 and reports: windows sandbox failed: helper_unknown_error: setup refresh had errors. The initial normal sandboxed PowerShell command also fails before process creation with the same setup-refresh error, while the equivalent read-only check succeeds with elevated sandbox approval. This blocks browser control and normal sandboxed commands. The issue began about a week ago. I fully terminated Codex, used Windows App Repair, and then completely uninstalled and reinstalled it; the failure persists. C:\tmp does not exist on this system. The installed package reports Status: Ok.
Update — resolved for my instance. Thanks @vlastimilvajnorak for sharing the targeted diagnostic steps in #39841 (comment). My sandbox log identified the repository .git directory as the failing path: the sandbox could not apply its deny ACE because that directory was owned by CodexSandboxOffline. Restoring ownership of that directory only to the Windows user fixed the issue immediately: normal sandboxed commands and the in-app browser now start successfully. No recursive ACL changes were needed.
The directory owner was CodexSandboxOffline. Restoring ownership of that directory only to my normal Windows user account fixed the problem immediately. No recursive ownership or ACL changes were needed.
After that, normal sandboxed terminal commands started working again. Thanks again for identifying such a precise and safe solution.
After reopening Codex, local execution worked again immediately:
git status
git --version
cmd.exe /c echo CODEX_CMD_OK
No reinstall, reclone, .git deletion, or recursive permission reset was needed.
So if you are seeing setup refresh had errors, check whether your .git directory is owned by CodexSandboxOffline. Restoring ownership to the normal Windows user may fix the issue.
deny ACE failed on C:\path\to\repo\.git:
SetNamedSecurityInfoW failed for C:\path\to\repo\.git: 5
or:
deny ACE failed on C:\path\to\repo\.codex:
SetNamedSecurityInfoW failed for C:\path\to\repo\.codex: 5
Windows error code 5 means:
Access Denied
The path reported in the log is the path that should be investigated.
2. Check the owner of the failing path
For example, if the log reports:
C:\path\to\repo\.git
check its owner:
(Get-Acl"C:\path\to\repo\.git").Owner
Or, if the failing path is:
C:\path\to\repo\.codex
run:
(Get-Acl"C:\path\to\repo\.codex").Owner
Normally, the owner should be the Windows account that owns the repository, for example:
MY-PC\myuser
A problematic case can look like:
MY-PC\CodexSandboxOffline
In that situation, the sandbox account appears to have incorrectly retained ownership of the directory. A later sandbox refresh may then fail when Codex tries to modify the ACL again.
3. Restore ownership only for the failing path
First, fully exit Codex Desktop.
Then open PowerShell as Administrator.
If the failing path is .git:
takeown /F "C:\path\to\repo\.git"
If the failing path is .codex:
takeown /F "C:\path\to\repo\.codex"
Then verify the owner:
(Get-Acl"C:\path\to\repo\.git").Owner
or:
(Get-Acl"C:\path\to\repo\.codex").Owner
The owner should now be your normal Windows account.
4. Do not recursively reset ACLs unless the log requires it
In most cases, commands such as these should not be necessary:
takeown /F "C:\path\to\repo"/R /D Y
or:
icacls "C:\path\to\repo"/reset /T /C
Codex uses specific Allow/Deny ACEs as part of its sandbox implementation. Recursively resetting the entire repository may remove ACL entries that Codex intentionally created.
The safer rule is:
log reports exact path
→ inspect that exact path
→ restore ownership only for that path
5. Restart Codex and verify the sandbox log
After restoring ownership, restart Codex Desktop.
A successful sandbox setup should contain output similar to:
I am seeing the same failure in the VS Code Codex extension.
Environment:
- OS: Microsoft Windows 11 Home, Version 10.0.26200 Build 26200
- VS Code: Version: 1.136.1 (user setup)
- Extension: `openai.chatgpt` version `26.901.22334`- Shell: Windows PowerShell 5.1
- PowerShell version: `5.1.26100.9278`- WSL: not installed
- Sandbox configuration: `[windows] sandbox = "elevated"`
The extension launches its bundled binaries from:
```text%USERPROFILE%\.vscode\extensions\openai.chatgpt-26.901.22334-win32-x64\bin\windows-x86_64\
Normal VS Code PowerShell and Claude Code work in the same workspace.
Codex logs repeatedly show:
codex_core::shell_snapshot: Failed to create shell snapshot for powershell: Shell snapshot not supported yet for PowerShell
followed by:
Failed to create unified exec process: helper_unknown_error: setup refresh had errors
Every subsequent exec_command fails before the requested process starts. Restarting VS Code, restarting the terminal, and restarting Windows did not resolve it.
This occurs in the VS Code extension rather than the standalone Codex CLI. Please advise whether this is the same Windows sandbox provisioning issue and whether extension-specific logs or diagnostics are needed.
I uploaded a portable Agent Skill, codex-windows-sandbox-repair, based on a Windows case where Codex failed before executing any command with:
helper_unknown_error: setup refresh had errors
SetNamedSecurityInfoW failed for <repo-root>\.codex: 5
The underlying issue was incorrect ownership of the repository’s .codex directory. The repair was:
1. Run PowerShell as Administrator.
2. Confirm the owner:
$repoRoot = (Get-Location).Path
$target = Join-Path $repoRoot '.codex'
(Get-Acl -LiteralPath $target).Owner
3. If the owner is a sandbox/service account rather than the interactive user, repair only that directory:
$repoRoot = (Get-Location).Path
$target = Join-Path $repoRoot '.codex'
$me = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
icacls.exe $target /setowner "$me"
(Get-Acl -LiteralPath $target).Owner
Do not use /T, modify .git, change global permissions, or alter OneDrive settings.
Afterward, fully restart Codex and verify with a fresh Codex-runner command such as:
Get-Location
This is an evidence-based repair for the specific SetNamedSecurityInfoW ... .codex: 5 signature, not a guaranteed fix for every setup refresh failure. Please redact usernames, domains, SIDs, full paths, feedback IDs, and other machine-specific information before sharing diagnostics publicly.
Le 28 septembre 2026, Codex Desktop sous Windows échoue avant le lancement de toute commande avec helper_unknown_error: setup refresh had errors. Plusieurs redémarrages n’ont pas résolu le problème. L’accès aux fichiers du projet est bloqué.
Additional Windows reproduction (2026-09-29, Asia/Shanghai).
Observed error in Codex Desktop when attempting even the minimal command Get-Location:
Failed to create unified exec process:
Rejected("Failed to create unified exec process: helper_unknown_error: setup refresh had errors")
Control tests performed outside Codex on the same Windows machine:
Windows PowerShell at C:\:
Get-Location
Succeeded and returned C:\.
Created an empty test directory:
mkdir C:\CodexExecTest
cd C:\CodexExecTest
Get-Location
Succeeded and returned C:\CodexExecTest.
In Codex Desktop, asked Codex to execute the same minimal command Get-Location. Codex reported that the command did not start and returned:
helper_unknown_error: setup refresh had errors
This provides a clean isolation result: Windows PowerShell itself and the empty directory are functional, while Codex fails before launching the requested process. The reproduction is therefore consistent with a Codex Desktop local execution/sandbox/workspace setup-refresh failure rather than a PowerShell command failure or corruption of the original project files.
Not yet verified in this reproduction: the specific underlying cause inside Codex (e.g. sandbox helper, ACL application, local configuration, security software interaction, or another setup-refresh component). No claim is made about root cause beyond the confirmed failure boundary above.
Additional confirmed Windows recovery — two separate issues, two narrow fixes (2026-11-08).
Environment: Windows 11 Enterprise 22631; ChatGPT/Codex desktop MSIX OpenAI.Codex 26.1103.4239.0; ESET Smart Security Premium 20; local Git checkout on D: (project name anonymized).
A. Desktop app activation was blocked separately: Windows AppModel-Runtime Event ID 203 reported 0x800704CF; ESET Browser protection log independently showed Blocked for the installed ...\OpenAI.Codex_26.1103.4239.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe. Adding that exact executable through the event's Add to browser protection allowlist action allowed the desktop app to open with ESET protection and firewall enabled. This was a Browser protection issue, not proof of a general network/firewall block; we did not disable protection permanently.
B. The local command runner still failed independently, even for pwd / Get-Location:
helper_unknown_error: setup refresh had errors
deny ACE failed on D:\<repo>\.git: open deny ACL target for update
(READ_CONTROL | WRITE_DAC): Access is denied. (os error 5)
ACL diagnostics: repository root owner was the interactive Windows account; only the .git directory owner was <HOST>\CodexSandboxOffline. icacls <repo>\.git /verify succeeded.
With the desktop fully closed, an elevated PowerShell ran the narrowly scoped, nonrecursive recovery:
Owner became the normal Windows account. After restarting the desktop app without elevation, both Get-Location and git status --short --branch completed successfully in the selected repository. No ACL reset, recursive ownership change, Git checkout reset, sandbox disablement, or reinstall was needed.
Diagnostic recommendation: inspect %USERPROFILE%\.codex\.sandbox\sandbox.<date>.log and the exact failing path before touching ownership. This is only applicable when the log and owner match. The ESET Browser protection allowlist remedy is specific to a logged exact executable block and should not be generalized into blanket security exclusions.
This independently confirms the .git ownership / deny-ACE failure mode already reported here.
This successfully changed ownership of .git to my normal Windows account, matching the repository's parent directory.
Importantly, this was a non-recursive ownership change. I did not modify ownership of the .git subdirectories or reset ACLs.
5. Verification
After reopening VS Code normally in the repository:
Codex successfully executed git status.
Codex successfully created a temporary file in the repository root.
Codex verified that the file existed.
Codex successfully deleted the temporary file.
No existing files were modified, staged, or committed.
Both command execution and filesystem writing are now working normally.
Conclusion
In this case, the failure was associated with the repository's .git directory being owned by CodexSandboxOffline.
Changing ownership to the Administrators group did not resolve it, but changing ownership directly to my normal Windows user did.
The successful repair required changing ownership only on the .git directory itself, not recursively across the repository.
It may be worth investigating why the Codex Windows sandbox can leave .git owned by its restricted account, and why subsequent sandbox setup cannot recover from that state automatically.
Additional context — possible trigger
One potentially important detail is that the failure began while Codex was working on Git-related operations in the repository.
At approximately the same time, GPT-6.1 Sol unexpectedly became unavailable, with Codex reporting that the model required a newer version of the application or CLI.
The interruption occurred before the Git-related work had been completed.
My suspicion is that the interruption may have occurred while Codex's Windows sandbox had temporarily changed ownership or permissions on parts of the repository's .git directory, leaving the filesystem in a state that subsequent sandbox initialisation could not recover from.
This is only a hypothesis; I cannot establish from the available logs whether the model interruption directly caused the ownership problem.
However, the timing may be relevant to investigating whether an interrupted Codex session or sandbox setup can leave directory ownership in an unrecoverable state.
The successful repair suggests that the sandbox's recovery behaviour following an interruption may be worth investigating.
I hope these findings help other affected Windows users and the Codex maintainers.
Additional reproduction and recovery on Windows (November 12, 2026, JST)
I observed the same .git ownership and ACL refresh failure in the Codex desktop app. Computer Use had worked on this PC before. On the next affected session, Node REPL exited with helper_unknown_error: setup refresh had errors before Computer Use could enumerate windows. Resetting Node REPL and retrying produced the same failure.
The Windows sandbox log showed a failed deny ACE update on <workspace>\.git when opening it with READ_CONTROL | WRITE_DAC (os error 5). The workspace directory was owned by my normal Windows user, while .git was owned by CodexSandboxOffline. I did not establish when or how that ownership changed.
Changing the owner as a normal user was denied. An elevated, non-recursive icacls /setowner operation restored ownership of the .git directory itself to the same Windows user as the workspace directory. I verified the new owner and did not reset ACLs or change ownership of the contents.
After resetting Node REPL, Computer Use initialized successfully. It could enumerate windows, launch an isolated copy of the target app by absolute executable path, identify the correct window, capture its screen, and interact with the app.
Ordinary sandboxed shell execution in the same session still failed during process creation (CreateProcessAsUserW failed: 5). The recovery was verified for Computer Use in this environment. The cause of the remaining shell error is unknown.
We stumbled across this while investigating a Windows Computer Use capture problem. Our .codex directory is on a different drive behind an NTFS junction. The run failed before it could list any windows, with helper_unknown_error: setup refresh had errors. The sandbox log pointed to the junction target: open deny ACL target for update (READ_CONTROL | WRITE_DAC) failed with Access is denied (os error 5).
We granted WRITE_DAC to the Windows user running Codex on the target directory itself, with no inheritance. In a subsequent test, Codex unexpectedly captured our app window and clicked a menu in it. We didn't disable the sandbox or reapply our old capture patch. That patch was for the legacy helper in Sky 0.7.21; the current installation had Sky 0.7.24, but we didn't independently verify which binary produced that specific frame.
The capture problem predates the junction, so we can't say the permission change fixed the original capture bug. The ACL error is the part we could pin down. Sharing in case it helps diagnose the same setup refresh error.
I hit this on Windows 10 when opening the in-app browser. The sandbox log showed deny ACE failed on <repo>\.git followed by open deny ACL target and os error 5. My Windows account already owned the .git directory.
With Codex closed, I ran the following in an elevated PowerShell under that same account, from the repository root:
This added an explicit read/execute entry on the .git directory itself. I left the existing deny entries in place and did not use /T. After reopening Codex in the same project, the in-app browser worked. The resulting ACL also showed inherited permissions, so I can confirm the sequence that worked on my machine, but I haven’t isolated which ACL change was decisive.
appIssues related to the Codex desktop appbugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Aug 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
vlastimilvajnorak commentedon Aug 23, 2026
Additional reproduction from a Windows Codex Desktop task on 2026-08-23:
This confirms the issue blocks read-only software-engineering workflows, not only application commands.
AlexeyAbubyakirov commentedon Aug 24, 2026
I can reproduce the same problem in Codex Desktop on Windows.
Every local command fails before execution, including:
Get-LocationGet-Content -Raw <file>The exact error is:
I also tried switching from the bundled PowerShell runtime to the system Windows PowerShell; the failure is unchanged. Restarting/reinstalling the Codex desktop app did not resolve it.
vlastimilvajnorak commentedon Aug 24, 2026
Additional reproduction after restarting Codex Desktop on 2026-08-24:
C:\___Projects\openai-apiC:\Program Files\Git\bin\bash.exebashdependencies\native\git\bin\bash.execmd.exe /cwrapper and failed before Bash started.pwd; git --versionnever executed.CreateProcess { message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")" }This means a full app restart and selecting an alternative shell do not provide a workaround. The failure occurs before the requested shell process starts. No repository files were modified.
yvescesso commentedon Aug 24, 2026
I am experiencing the same issue on Windows.
The problem persists after repairing and resetting the ChatGPT app,
restarting Windows, running the app as administrator, and creating a new task.
Workspace:
C:\wamp\www\yorkfrance-php8x27
Workspace owner:
BEELINK-PC\yves
Feedback ID:
01a030e1-174d-78e2-aa70-15f10e5597bb
orlay626 commentedon Aug 24, 2026
I can independently reproduce this on Windows in the Codex desktop app today (2026-08-24).
Symptoms match this issue exactly:
Get-Locationtest.Failed to create unified exec process: helper_unknown_error: setup refresh had errorsD:).This is currently blocking further local development/testing because even a basic read-only shell command cannot start.
Happy to provide additional non-sensitive diagnostics if there is a recommended collection procedure.
icrevinversiones-stack commentedon Aug 24, 2026
I can reproduce the same failure on a newer Windows app version.
App version: 26.818.5229.0
Subscription: ChatGPT Pro (5×)
Platform: Microsoft Windows NT 10.0.26200.0 x64
The error is intermittent: one PowerShell command may succeed, while the next independent command fails before process creation with:
Failed to create unified exec process: helper_unknown_error: setup refresh had errors
The issue also affected in-app browser control in a previous task. It persisted after repairing the app, restarting Windows, and starting a new task.
Feedback ID with session and browser logs:
01a03224-b13f-73a1-90d2-43c1bb438f87
kleinjoshua298-byte commentedon Aug 25, 2026
I can reproduce this error on app version 26.819.11345 on windows 11 x64
Reproducible with; Get-Date -Format o (or any powershell command)
helper_unknown_error: setup refresh had errors
Persists after reinstall and restart
vlastimilvajnorak commentedon Aug 25, 2026
Additional reproduction from Codex Desktop on Windows on 2026-08-25:
C:\___Projectshelper_unknown_error: setup refresh had errors.C:\Program Files\Git\bin\bash.exeandC:\Program Files\Git\usr\bin\bash.exedid not start Git Bash; the execution result instead showed acmd.exe /cwrapper and failed during setup.C:\Program Files\Git\bin\bash.exefrom the bundled PowerShell runtime also failed before Bash started.pwdnever executed.This confirms the failure persists across another local workspace and blocks explicit alternative-shell selection as well as direct shell invocation.
icrevinversiones-stack commentedon Aug 25, 2026
Still reproducible after updating the Windows app.
Previous version: 26.818.5229.0
Current version: 26.818.8289.0
Platform: Microsoft Windows NT 10.0.26200.0 x64
Immediately after the update, a read-only Get-Location command again failed before PowerShell started with:
Failed to create unified exec process: helper_unknown_error: setup refresh had errors
No repository files were modified and no external operation was attempted.
Related feedback ID:
01a03224-b13f-73a1-90d2-43c1bb438f87
pocketlinkDev commentedon Aug 25, 2026
Additional reproduction on 2026-08-25:
A minimal
Get-Locationcommand fails before PowerShell starts with:CreateProcess { message: "Rejected(\"Failed to create unified exec process: helper_unknown_error: setup refresh had errors\")" }The same sandbox setup failure also affects:
apply_patch, while trying to read/verify a workspace fileAn explicitly approved out-of-sandbox execution succeeds with:
This suggests the underlying repository and filesystem access are functional and the failure is specifically in Windows sandbox setup/refresh.
2 remaining items
MadMick96 commentedon Aug 26, 2026
Confirmed fix for my instance of this issue on Windows.
The displayed error was:
The specific cause was recorded in:
My log contained:
Checking the directory showed that
.gitwas incorrectly owned byCodexSandboxOffline:I opened PowerShell as Administrator and restored ownership of only that directory:
After restarting Codex:
.gitwas owned by my Windows account;errors=[];This fix is path-specific. Other instances of
setup refresh had errorsmay involve Temp, WindowsApps, WSL/UNC paths, or another workspace directory. Check the current sandbox log for the exact failing path before changing ownership or permissions. Recursive ACL changes should not be necessary unless the log explicitly identifies child paths.ablazhko commentedon Aug 26, 2026
I can reproduce this on Codex Desktop 26.820.7780.0 on Windows x64 in a local workspace. On 2026-08-26 (Europe/Warsaw), Browser startup via node_repl fails before browser selection. The Node kernel exits with code 1 and reports: windows sandbox failed: helper_unknown_error: setup refresh had errors. The initial normal sandboxed PowerShell command also fails before process creation with the same setup-refresh error, while the equivalent read-only check succeeds with elevated sandbox approval. This blocks browser control and normal sandboxed commands. The issue began about a week ago. I fully terminated Codex, used Windows App Repair, and then completely uninstalled and reinstalled it; the failure persists. C:\tmp does not exist on this system. The installed package reports Status: Ok.
ablazhko commentedon Aug 26, 2026
Update — resolved for my instance. Thanks @vlastimilvajnorak for sharing the targeted diagnostic steps in #39841 (comment). My sandbox log identified the repository .git directory as the failing path: the sandbox could not apply its deny ACE because that directory was owned by CodexSandboxOffline. Restoring ownership of that directory only to the Windows user fixed the issue immediately: normal sandboxed commands and the in-app browser now start successfully. No recursive ACL changes were needed.
yvescesso commentedon Aug 26, 2026
Thank you, @ablazhko — your diagnosis and targeted fix resolved the issue for me.
My sandbox log showed the same failure on the workspace repository’s
.gitdirectory:deny ACE failed ... .git: SetNamedSecurityInfoW failed ... : 5The directory owner was
CodexSandboxOffline. Restoring ownership of that directory only to my normal Windows user account fixed the problem immediately. No recursive ownership or ACL changes were needed.After that, normal sandboxed terminal commands started working again. Thanks again for identifying such a precise and safe solution.
normandiazr64 commentedon Aug 26, 2026
Confirmed workaround on Windows
I was hitting the same error:
Codex could not start PowerShell, CMD, Git, or any local process.
I checked:
and found:
5=Access Denied.Then I checked the
.gitowner:It was unexpectedly owned by:
instead of my normal Windows account.
Fix
I closed Codex completely, opened PowerShell as Administrator, and ran:
After reopening Codex, local execution worked again immediately:
No reinstall, reclone,
.gitdeletion, or recursive permission reset was needed.So if you are seeing
setup refresh had errors, check whether your.gitdirectory is owned byCodexSandboxOffline. Restoring ownership to the normal Windows user may fix the issue.mzzyb commentedon Aug 27, 2026
@MadMick96 Thank you . Based on your answer, it is currently resolved!
On Windows, Codex Desktop may fail with:
This usually means that the Codex Windows sandbox failed while applying or refreshing filesystem ACLs.
1. Check the current sandbox log
Sandbox logs are located under:
You can locate the newest log with PowerShell:
Then inspect the end of that log:
Look for an error similar to:
or:
Windows error code
5means:The path reported in the log is the path that should be investigated.
2. Check the owner of the failing path
For example, if the log reports:
check its owner:
Or, if the failing path is:
run:
Normally, the owner should be the Windows account that owns the repository, for example:
A problematic case can look like:
In that situation, the sandbox account appears to have incorrectly retained ownership of the directory. A later sandbox refresh may then fail when Codex tries to modify the ACL again.
3. Restore ownership only for the failing path
First, fully exit Codex Desktop.
Then open PowerShell as Administrator.
If the failing path is
.git:If the failing path is
.codex:Then verify the owner:
or:
The owner should now be your normal Windows account.
4. Do not recursively reset ACLs unless the log requires it
In most cases, commands such as these should not be necessary:
or:
Codex uses specific Allow/Deny ACEs as part of its sandbox implementation. Recursively resetting the entire repository may remove ACL entries that Codex intentionally created.
The safer rule is:
5. Restart Codex and verify the sandbox log
After restoring ownership, restart Codex Desktop.
A successful sandbox setup should contain output similar to:
The important indicator is:
The following should no longer appear:
or:
6. Test normal sandbox filesystem operations
After restarting, test a few basic operations through Codex:
tdquerec commentedon Sep 5, 2026
Normal VS Code PowerShell and Claude Code work in the same workspace.
Codex logs repeatedly show:
followed by:
Every subsequent
exec_commandfails before the requested process starts. Restarting VS Code, restarting the terminal, and restarting Windows did not resolve it.This occurs in the VS Code extension rather than the standalone Codex CLI. Please advise whether this is the same Windows sandbox provisioning issue and whether extension-specific logs or diagnostics are needed.
tdquerec commentedon Sep 5, 2026
codex-windows-sandbox-repair.zip
I uploaded a portable Agent Skill,
codex-windows-sandbox-repair, based on a Windows case where Codex failed before executing any command with:doddynicolas commentedon Sep 28, 2026
Le 28 septembre 2026, Codex Desktop sous Windows échoue avant le lancement de toute commande avec
helper_unknown_error: setup refresh had errors. Plusieurs redémarrages n’ont pas résolu le problème. L’accès aux fichiers du projet est bloqué.lingsanyue6-beep commentedon Sep 29, 2026
Additional Windows reproduction (2026-09-29, Asia/Shanghai).
Observed error in Codex Desktop when attempting even the minimal command
Get-Location:Control tests performed outside Codex on the same Windows machine:
C:\:Get-LocationSucceeded and returned
C:\.mkdir C:\CodexExecTest cd C:\CodexExecTest Get-LocationSucceeded and returned
C:\CodexExecTest.Get-Location. Codex reported that the command did not start and returned:This provides a clean isolation result: Windows PowerShell itself and the empty directory are functional, while Codex fails before launching the requested process. The reproduction is therefore consistent with a Codex Desktop local execution/sandbox/workspace setup-refresh failure rather than a PowerShell command failure or corruption of the original project files.
Not yet verified in this reproduction: the specific underlying cause inside Codex (e.g. sandbox helper, ACL application, local configuration, security software interaction, or another setup-refresh component). No claim is made about root cause beyond the confirmed failure boundary above.
ImanCognitiveArch commentedon Nov 8, 2026
Additional confirmed Windows recovery — two separate issues, two narrow fixes (2026-11-08).
Environment: Windows 11 Enterprise 22631; ChatGPT/Codex desktop MSIX
OpenAI.Codex26.1103.4239.0; ESET Smart Security Premium 20; local Git checkout onD:(project name anonymized).A. Desktop app activation was blocked separately: Windows AppModel-Runtime Event ID 203 reported
0x800704CF; ESET Browser protection log independently showedBlockedfor the installed...\OpenAI.Codex_26.1103.4239.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe. Adding that exact executable through the event's Add to browser protection allowlist action allowed the desktop app to open with ESET protection and firewall enabled. This was a Browser protection issue, not proof of a general network/firewall block; we did not disable protection permanently.B. The local command runner still failed independently, even for
pwd/Get-Location:ACL diagnostics: repository root owner was the interactive Windows account; only the
.gitdirectory owner was<HOST>\CodexSandboxOffline.icacls <repo>\.git /verifysucceeded.With the desktop fully closed, an elevated PowerShell ran the narrowly scoped, nonrecursive recovery:
Owner became the normal Windows account. After restarting the desktop app without elevation, both
Get-Locationandgit status --short --branchcompleted successfully in the selected repository. No ACL reset, recursive ownership change, Git checkout reset, sandbox disablement, or reinstall was needed.Diagnostic recommendation: inspect
%USERPROFILE%\.codex\.sandbox\sandbox.<date>.logand the exact failing path before touching ownership. This is only applicable when the log and owner match. The ESET Browser protection allowlist remedy is specific to a logged exact executable block and should not be generalized into blanket security exclusions.This independently confirms the
.gitownership / deny-ACE failure mode already reported here.michaeloman223 commentedon Nov 11, 2026
Confirmed Windows sandbox failure and successful fix — VS Code Codex extension
I encountered the
helper_unknown_error: setup refresh had errorsproblem on Windows 11 Pro, after Codex had previously worked reliably for weeks.I've now successfully resolved it and wanted to share the diagnostic findings and exact repair.
Environment
openai.chatgpt-26.1106.51428-win32-x640.167.0-alpha.4.11. Exact failure identified in sandbox log
The log at
%USERPROFILE%\.codex\.sandbox\sandbox.2026-11-11.logcontained:Codex could not execute even
git statuswhen VS Code was opened directly in the repository.2. Ownership investigation
Running:
returned:
The repository's parent directory was owned by my normal Windows account, but
.gitwas owned by the restricted Codex sandbox account.Several directories inside
.git, includinghooks,info,objects, andrefs, were also owned byCodexSandboxOffline.3. First attempted repair — insufficient
With VS Code closed, I opened PowerShell as Administrator and ran:
This successfully changed ownership of
.gittoBUILTIN\Administrators.However, Codex still failed with the identical error, confirmed in the updated sandbox log.
4. Successful repair
With VS Code closed, I again opened PowerShell as Administrator and ran:
This successfully changed ownership of
.gitto my normal Windows account, matching the repository's parent directory.Importantly, this was a non-recursive ownership change. I did not modify ownership of the
.gitsubdirectories or reset ACLs.5. Verification
After reopening VS Code normally in the repository:
git status.Both command execution and filesystem writing are now working normally.
Conclusion
In this case, the failure was associated with the repository's
.gitdirectory being owned byCodexSandboxOffline.Changing ownership to the Administrators group did not resolve it, but changing ownership directly to my normal Windows user did.
The successful repair required changing ownership only on the
.gitdirectory itself, not recursively across the repository.It may be worth investigating why the Codex Windows sandbox can leave
.gitowned by its restricted account, and why subsequent sandbox setup cannot recover from that state automatically.Additional context — possible trigger
One potentially important detail is that the failure began while Codex was working on Git-related operations in the repository.
At approximately the same time, GPT-6.1 Sol unexpectedly became unavailable, with Codex reporting that the model required a newer version of the application or CLI.
The interruption occurred before the Git-related work had been completed.
My suspicion is that the interruption may have occurred while Codex's Windows sandbox had temporarily changed ownership or permissions on parts of the repository's
.gitdirectory, leaving the filesystem in a state that subsequent sandbox initialisation could not recover from.This is only a hypothesis; I cannot establish from the available logs whether the model interruption directly caused the ownership problem.
However, the timing may be relevant to investigating whether an interrupted Codex session or sandbox setup can leave directory ownership in an unrecoverable state.
The successful repair suggests that the sandbox's recovery behaviour following an interruption may be worth investigating.
I hope these findings help other affected Windows users and the Codex maintainers.
nicolion0322-sketch commentedon Nov 12, 2026
Additional reproduction and recovery on Windows (November 12, 2026, JST)
I observed the same
.gitownership and ACL refresh failure in the Codex desktop app. Computer Use had worked on this PC before. On the next affected session, Node REPL exited withhelper_unknown_error: setup refresh had errorsbefore Computer Use could enumerate windows. Resetting Node REPL and retrying produced the same failure.The Windows sandbox log showed a failed deny ACE update on
<workspace>\.gitwhen opening it withREAD_CONTROL | WRITE_DAC(os error 5). The workspace directory was owned by my normal Windows user, while.gitwas owned byCodexSandboxOffline. I did not establish when or how that ownership changed.Changing the owner as a normal user was denied. An elevated, non-recursive
icacls /setowneroperation restored ownership of the.gitdirectory itself to the same Windows user as the workspace directory. I verified the new owner and did not reset ACLs or change ownership of the contents.After resetting Node REPL, Computer Use initialized successfully. It could enumerate windows, launch an isolated copy of the target app by absolute executable path, identify the correct window, capture its screen, and interact with the app.
Ordinary sandboxed shell execution in the same session still failed during process creation (
CreateProcessAsUserW failed: 5). The recovery was verified for Computer Use in this environment. The cause of the remaining shell error is unknown.honinst commentedon Nov 23, 2026
We stumbled across this while investigating a Windows Computer Use capture problem. Our
.codexdirectory is on a different drive behind an NTFS junction. The run failed before it could list any windows, withhelper_unknown_error: setup refresh had errors. The sandbox log pointed to the junction target:open deny ACL target for update (READ_CONTROL | WRITE_DAC)failed withAccess is denied (os error 5).We granted
WRITE_DACto the Windows user running Codex on the target directory itself, with no inheritance. In a subsequent test, Codex unexpectedly captured our app window and clicked a menu in it. We didn't disable the sandbox or reapply our old capture patch. That patch was for the legacy helper in Sky 0.7.21; the current installation had Sky 0.7.24, but we didn't independently verify which binary produced that specific frame.The capture problem predates the junction, so we can't say the permission change fixed the original capture bug. The ACL error is the part we could pin down. Sharing in case it helps diagnose the same
setup refresherror.olubinskiszymon-pixel commentedon Nov 24, 2026
I hit this on Windows 10 when opening the in-app browser. The sandbox log showed
deny ACE failed on <repo>\.gitfollowed byopen deny ACL targetandos error 5. My Windows account already owned the.gitdirectory.With Codex closed, I ran the following in an elevated PowerShell under that same account, from the repository root:
This added an explicit read/execute entry on the
.gitdirectory itself. I left the existing deny entries in place and did not use/T. After reopening Codex in the same project, the in-app browser worked. The resulting ACL also showed inherited permissions, so I can confirm the sequence that worked on my machine, but I haven’t isolated which ACL change was decisive.