Repository navigation
Setup Refresh had Errors #48759
Description
What issue are you seeing?
I'm repeatedly unable to use the command/workspace execution environment.
Error:
helper_unknown_error: setup refresh had errors
This is occurring across multiple sessions, including a fresh session.
I also tested a minimal read-only command (Get-Location). The command never started because the execution environment returned the same setup refresh error.
This does not appear to be related to my project code. The failure occurs before command execution, and the agent reports that no files were modified.
Impact:
I cannot access the workspace, inspect the repository, run tests, or continue development.
Troubleshooting already attempted:
- Retried workspace access
- Started a fresh session
- Retried with a minimal read-only command
- Avoided making project changes
- Same setup refresh error persists
Please investigate the workspace/command environment setup failure.
What steps can reproduce the bug?
The Codex workspace/command execution environment repeatedly fails to initialise with:
helper_unknown_error: setup refresh had errors
Steps to reproduce:
- Open a Codex coding session with an existing project/workspace.
- Ask Codex to inspect the workspace or execute a command.
- The command environment fails to initialise and returns:
helper_unknown_error: setup refresh had errors - Start a completely fresh Codex session and try again.
- The same error occurs.
- As a minimal test, ask Codex to execute only the read-only PowerShell command:
Get-Location - Even this command fails before execution with the same setup refresh error.
The issue persists across multiple sessions and is not limited to a particular project command.
Codex reports that the command fails before it starts and that no project files are modified.
Expected behaviour:
The workspace execution environment should initialise successfully and allow commands such as Get-Location to run.
Actual behaviour:
The execution environment fails during setup/refresh, preventing all workspace access and command execution.
Impact:
I cannot inspect my repository, run tests, execute commands, or continue development because Codex cannot access the workspace.
I have already tried:
- Retrying workspace access
- Retrying the existing session
- Starting a fresh session
- Using a minimal read-only command
- Waiting and trying again
The same error continues to occur.
What is the expected behavior?
The Codex workspace/command environment should initialise successfully when a coding session starts.
Once initialised, Codex should be able to access the selected workspace and execute permitted commands normally.
For the minimal reproduction case, the read-only PowerShell command:
Get-Location
should execute successfully and return the current workspace directory.
For my normal workflow, Codex should then be able to inspect the existing repository, read project files, run the project's test/build commands, and continue development from the existing workspace state without producing a setup refresh error.
Starting a fresh Codex session should also create a functioning command environment rather than reproducing the same environment-initialisation failure.
Additional information
No response
Activity
github-actions commentedon Sep 27, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
sanaro99 commentedon Oct 2, 2026
I encountered this same setup-refresh failure on Windows with Codex Desktop 26.928.40906. It prevented both normal shell startup and browser/computer-use initialization. The sanitized setup log identified a failed deny-ACE update on the repository’s root
.gitdirectory; its owner wasCodexSandboxOffline.With Windows elevation, changing only that directory’s owner to the interactive user restored both the sandboxed shell and
cua.getState()without changing the sandbox configuration or resetting its ACL. I added the fuller report to #43776, since it covers a related ownership/setup failure.ujustbetech commentedon Oct 7, 2026
Fix: Codex on Windows fails with
helper_unknown_error: setup refresh had errorsProblem
After restarting my laptop while a Codex task was running, every command in Codex failed with:
The exit code was
-1for bothcmdand PowerShell commands. Sometimes I also saw:The commands themselves never ran. The failure was in Codex's own Windows sandbox/exec environment, not in my project code.
Diagnosis
~\.codex\.sandbox\setup_error.jsoncontained:{ "code": "helper_unknown_error", "message": "setup refresh had errors" }~\.codex\.sandbox\sandbox.<date>.log). The key error was:node_repl.exefrom PowerShell. The file was locked.It was not caused by my Next.js development servers.
takeownoricacls /reset.What did not fix it by itself
Stop-Process -Force. Codex recreated the runtime and the error returned.explorer.exe. Resource Monitor showed Explorer holding handles inside the Codex runtime folder....\runtimes\cua_node\<hash>→<hash>.bak) so Codex could rebuild it.What fixed it
With Codex fully closed, I changed the Windows sandbox setting in
~\.codex\config.toml.From:
To:
After fully restarting Codex and starting a new thread, commands executed normally again. For example,
dirworked successfully.I backed up the configuration before editing:
Copy-Item ~\.codex\config.toml ~\.codex\config.toml.bakI also moved the previous sandbox error state aside so I could distinguish fresh errors from old ones:
Why
unelevatedworksThe issue appears to occur during the Windows elevated sandbox setup/refresh process. Switching to
sandbox = "unelevated"avoids that failing setup path, allowing Codex's command environment to start normally.This means the change does not fix or unlock
node_repl.exeitself. Instead, it avoids the sandbox setup path that was failing.Temporary workaround
This is a temporary workaround, not a permanent fix.
unelevatedprovides weaker sandbox isolation thanelevated. The preferred long-term configuration is still:once the underlying Windows elevated-sandbox issue is fixed. A proper permanent fix should let the elevated sandbox initialize successfully without producing
helper_unknown_error: setup refresh had errors.What to do until the issue is fixed
Keep
sandbox = "unelevated"and continue using Codex normally. There is no need to repeatedly delete or rebuild the Codex runtime.Current status:
sandbox = "unelevated"helper_unknown_error: setup refresh had errorsThe normal Codex workflow keeps working, including:
Because
unelevatedprovides weaker isolation, it is preferable to keep command approvals/review enabled rather than allowing unrestricted automatic execution.Re-test after a Codex update
After a future Codex update, test whether the elevated sandbox has been fixed:
dir.If it works, the stronger elevated sandbox can be restored.
If the same
helper_unknown_error: setup refresh had errorserror returns, switch back to:and keep it there until the underlying issue is resolved.
tk-Ravi commentedon Oct 8, 2026
I’m seeing this in a Codex desktop session on Windows too.
Workspace command execution fails before the command starts:
exec_command failed: CreateProcess { message: "Rejected("Failed to create unified exec process: helper_unknown_error: setup refresh had errors")" }
The computer-use environment also failed to initialize with:
windows sandbox failed: helper_unknown_error: setup refresh had errors
This happened repeatedly during attempts to access my local workspace. Codex could not inspect or edit any project files.
Codex version: 26.1002.52244
Windows version: Windows 10 Pro, 22H2, 19045.7725.
hedarfu commentedon Oct 8, 2026
Another data point with a clean on/off repro. In our case the lock comes from the desktop app's computer-use runtime, and it breaks the CLI too.
Environment: Windows 11 Pro 26H2 (build 26300.9550), x64.
codex-cli 0.162.0-alpha.2, which is the CLI binary the desktop app installs under%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe. Desktop app: MSIX packageOpenAI.Codex(26.930.7945.0, auto-updated on 2026-10-08). The CLI runs non-interactively ascodex exec -s workspace-write -c windows.sandbox="elevated".Repro
codex-computer-use-swift.exestarts fromruntimes\cua_node\<hash>\....codex execwith any prompt that executes a shell command. It fails:errors=[].%USERPROFILE%\.codex\.sandbox\sandbox.<date>.log:The process holding
VCRUNTIME140_1.dllwascodex-computer-use-swift.exe, launched by the desktop app from that samecua_noderuntime. That day the machine ran 83 setup refreshes. 80 haderrors=[], and the only 3 that failed all ran while the app was open.So the elevated setup refresh tries to open runtime files for an ACL update, and those files are in use by the computer-use helper. It looks like the refresh should either skip runtime files that are already in use (their ACLs were already validated), or not treat a sharing violation on them as fatal. In the meantime, the error could name the process holding the lock.
Workaround: we don't launch CLI agents on that machine while
codex-computer-use-swift.exeis running.Frostvalk commentedon Oct 9, 2026
Title: Windows 11: Codex integrated terminal does not open; local command execution fails
Environment
What happens
Ctrl + ^keyboard shortcut also does nothing.Failed to create unified exec process: helper_unknown_error: setup refresh had errors01a10c34-4115-7752-b9df-9001ff9173caWhat I tried
codex doctorin a standalone PowerShell window. PowerShell reported thatcodexis not recognized, so the separate CLI diagnostic could not run.Expected result
The integrated terminal should open in the local project chat and allow commands to run.
Please investigate the Windows desktop app’s terminal and local command environment. I have not changed sandbox settings or Windows permissions.
mmoad454-art commentedon Oct 9, 2026
Adding another reproduction from a Windows desktop computer-use workflow that is blocking development of a local project (NetMedic).
Feedback ID:
01a11996-6fc3-749d-b877-4664db4050c2Observed: 2026-10-09, approximately 17:23 (Saudi Arabia, UTC+03:00).
The computer appears connected and authorized in the desktop UI, and the task can be submitted, but even a minimal read-only PowerShell command fails before the process is created:
Local project discovery also fails with
DesktopProjectsUnavailableError. The tool returns no PowerShell exit code or execution session. The device connection menu shows the computer selected, but does not offer a reconnect option (only revoke access, which was not used).This is blocking autonomous work on the NetMedic application. There is no evidence the failure originates in the project source or Windows permissions; the failure appears to occur during execution-channel initialization.
A feedback report has been submitted with the ID above. Please investigate the desktop execution/setup-refresh failure, and whether project discovery is affected by the same underlying issue.
venturi01 commentedon Oct 12, 2026
Additional Windows desktop reproduction and successful targeted workaround, observed October 11–12, 2026. Posted with the affected user's authorization; personal paths are redacted.
Environment observed
OpenAI.Codex_26.1002.7124.0_x64(package version, not a separately collected About-dialog version).%LOCALAPPDATA%\OpenAI\Codex\bin\9691020b546a15b2\codex.exe.%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin.Error and process identification
Top-level failure:
Sandbox log's fatal error:
A read-only Windows Restart Manager query (RmRegisterResources/RmGetList) against that exact executable reported two node_repl.exe processes. Process ancestry traced both to this Codex backend, one directly and one through its Node helper.
Controlled recovery sequence
Get-Location. Setup still failed, but the fatal target changed fromnode_repl.exetonode.exein the same runtime../server.mjs; their cmd.exe parent command lines identified:scripts\launch_code_review_mcp.cmd./scripts/launch_codex_app_tools_mcp.cmd ./server.mjsBoth traced to the same Codex backend.
Write-Output 'Sandbox execution succeeded'; Get-Location). It succeeded with exit code 0, without an outside-sandbox override. Subsequent ordinary local reads also worked.No sandbox configuration changes, permission resets, runtime deletion, or reinstall were performed during this recovery. Stopping these helpers may interrupt their integrations.
What this establishes / limits
The observed sequence supports live bundled runtime processes blocking sandbox ACL setup: removing only node_repl processes exposed a second blocker in the code-review/app-tools Node services, and releasing both groups allowed setup to complete.
This is a session-level workaround, not proof of a permanent repair. We have not tested recurrence after all integrations respawn, nor established the precise CreateFile access/share flags responsible.
Please investigate runtime startup versus sandbox permission-refresh ordering and access requested during ACL validation. Reporting the actual target file and responsible process in the user-facing error would also greatly improve diagnosis.