Codex Desktop stuck in "Windows Setup Incomplete" loop despite Windows Sandbox feature enabled
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.4979.0
What subscription do you have?
Free
What platform is your computer?
Windows 11 Pro
What issue are you seeing?
Environment
OS: Windows 11 Pro (专业版)
Codex Desktop version: 26.721.4979.0 (fresh reinstall via winget install --id 9PLM9XGG6VKS --source msstore)
Codex CLI version: 0.142.5 (works normally, confirmed via codex --version and interactive session)
CPU virtualization: Enabled (BIOS-level VT confirmed via systeminfo)
Windows Sandbox feature (Containers-DisposableClientVM): Enabled (was Disabled, manually enabled + rebooted)
Virtual Machine Platform (VirtualMachinePlatform): Enabled
No antivirus/security software conflicts detected in this session (though Tencent PC Manager is present on the machine and cannot be fully ruled out)
Steps to reproduce
Fresh install of Codex Desktop via winget/Microsoft Store.
Launch app for the first time.
App shows "完成 Windows 设置" (Complete Windows Setup) screen: "ChatGPT 需要一次性权限才能在你的电脑上运行" (ChatGPT needs one-time permission to run on your computer).
Click through, Windows UAC prompt appears (publisher verified: OpenAI LLC), click "是" (Yes) to grant permission.
Immediately after granting UAC, screen shows red error: "Windows 安装未完成" (Windows setup not complete), with two options: "重试 Windows 设置" (Retry Windows Setup) and "继续受限访问" (Continue with limited access).
Clicking "重试 Windows 设置" repeats steps 3-5 in a loop.
Clicking "继续受限访问" (the documented fallback/unelevated path) also fails to proceed past this screen.
What we verified was NOT the cause
config.toml correctly set to:
toml
sandbox_mode = "workspace-write"
approval_policy = "on-request"
[windows]
sandbox = "unelevated"
sandbox_private_desktop = false
[features]
unified_exec = false
shell_snapshot = true
Confirmed via Get-Content immediately after write — config persists correctly.
No stale codex/ChatGPT processes holding file handles (verified with Sysinternals handle64.exe — "No matching handles found").
No scheduled tasks or startup items relaunching the process (Get-ScheduledTask, Get-CimInstance Win32_StartupCommand both empty).
Windows Sandbox and VirtualMachinePlatform optional features both Enabled and machine rebooted after enabling.
Separated .codex (Desktop) and .codex_cli (CLI) directories via CODEX_HOME env var to rule out config directory contention between CLI and Desktop.
Fully uninstalled (Remove-AppxPackage) and reinstalled the app fresh via winget — same failure reproduced on brand-new install with no prior config present.
Checked Windows Event Viewer (Application and System logs, 2-hour window) — only found install-success entries, no error/warning entries referencing Codex/ChatGPT/Sandbox.
Checked .codex\sandbox.*.log files — no new log file was generated for the failed attempt at all, suggesting the failure happens before the sandbox setup process even begins logging.
Key observation
Because no sandbox.log entry is created for the failed attempt, and no Windows Event Log entry is created either, the failure appears to occur very early in Codex Desktop's internal setup flow — before it even reaches the point of invoking the native Windows Sandbox APIs. This suggests the bug is likely in the Desktop app's setup-flow logic itself (e.g., how it interprets the UAC grant result, or how it decides whether setup succeeded), rather than in the actual sandbox creation.
Workaround
Codex CLI (v0.142.5) works completely normally on the same machine, using a separate CODEX_HOME directory. Recommend using CLI as a workaround until this Desktop-specific setup flow is fixed.
Related known issues
This appears consistent with:
https://github.com/openai/codex/issues/23712 (unelevated sandbox still repeatedly launches elevated setup helper)
https://github.com/openai/codex/issues/29622 (elevated sandbox setup blocks app startup with a retry loop that never succeeds)
What steps can reproduce the bug?
Environment
OS: Windows 11 Pro (专业版)
Codex Desktop version: 26.721.4979.0 (fresh reinstall via winget install --id 9PLM9XGG6VKS --source msstore)
Codex CLI version: 0.142.5 (works normally, confirmed via codex --version and interactive session)
CPU virtualization: Enabled (BIOS-level VT confirmed via systeminfo)
Windows Sandbox feature (Containers-DisposableClientVM): Enabled (was Disabled, manually enabled + rebooted)
Virtual Machine Platform (VirtualMachinePlatform): Enabled
No antivirus/security software conflicts detected in this session (though Tencent PC Manager is present on the machine and cannot be fully ruled out)
Steps to reproduce
Fresh install of Codex Desktop via winget/Microsoft Store.
Launch app for the first time.
App shows "完成 Windows 设置" (Complete Windows Setup) screen: "ChatGPT 需要一次性权限才能在你的电脑上运行" (ChatGPT needs one-time permission to run on your computer).
Click through, Windows UAC prompt appears (publisher verified: OpenAI LLC), click "是" (Yes) to grant permission.
Immediately after granting UAC, screen shows red error: "Windows 安装未完成" (Windows setup not complete), with two options: "重试 Windows 设置" (Retry Windows Setup) and "继续受限访问" (Continue with limited access).
Clicking "重试 Windows 设置" repeats steps 3-5 in a loop.
Clicking "继续受限访问" (the documented fallback/unelevated path) also fails to proceed past this screen.
What we verified was NOT the cause
config.toml correctly set to:
toml
sandbox_mode = "workspace-write"
approval_policy = "on-request"
[windows]
sandbox = "unelevated"
sandbox_private_desktop = false
[features]
unified_exec = false
shell_snapshot = true
Confirmed via Get-Content immediately after write — config persists correctly.
No stale codex/ChatGPT processes holding file handles (verified with Sysinternals handle64.exe — "No matching handles found").
No scheduled tasks or startup items relaunching the process (Get-ScheduledTask, Get-CimInstance Win32_StartupCommand both empty).
Windows Sandbox and VirtualMachinePlatform optional features both Enabled and machine rebooted after enabling.
Separated .codex (Desktop) and .codex_cli (CLI) directories via CODEX_HOME env var to rule out config directory contention between CLI and Desktop.
Fully uninstalled (Remove-AppxPackage) and reinstalled the app fresh via winget — same failure reproduced on brand-new install with no prior config present.
Checked Windows Event Viewer (Application and System logs, 2-hour window) — only found install-success entries, no error/warning entries referencing Codex/ChatGPT/Sandbox.
Checked .codex\sandbox.*.log files — no new log file was generated for the failed attempt at all, suggesting the failure happens before the sandbox setup process even begins logging.
Key observation
Because no sandbox.log entry is created for the failed attempt, and no Windows Event Log entry is created either, the failure appears to occur very early in Codex Desktop's internal setup flow — before it even reaches the point of invoking the native Windows Sandbox APIs. This suggests the bug is likely in the Desktop app's setup-flow logic itself (e.g., how it interprets the UAC grant result, or how it decides whether setup succeeded), rather than in the actual sandbox creation.
Workaround
Codex CLI (v0.142.5) works completely normally on the same machine, using a separate CODEX_HOME directory. Recommend using CLI as a workaround until this Desktop-specific setup flow is fixed.
Related known issues
This appears consistent with:
https://github.com/openai/codex/issues/23712 (unelevated sandbox still repeatedly launches elevated setup helper)
https://github.com/openai/codex/issues/29622 (elevated sandbox setup blocks app startup with a retry loop that never succeeds)
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional Windows 10 data point, with CLI isolation tests.
What issue are you seeing?
I am seeing a Windows-specific inconsistency between Codex Desktop Windows setup and Codex CLI sandbox behavior on a secondary local Windows user.
Environment:
On the secondary Windows user, Codex Desktop repeatedly asks to complete Windows setup.
The UAC elevation prompt appears and can be approved with valid administrator credentials. After approval, the app appears to continue setup, but later returns to the state where Windows setup is still incomplete. Retrying repeats the cycle.
At the same time, CLI behavior is inconsistent:
codex exec --sandbox workspace-write ...starts with:
and file writes fail.
However, the lower-level sandbox itself is functional. This command:
successfully creates the file.
Also, this command:
codex exec --approve-for-mesuccessfully modifies files, even though the session header still reports:
So there appear to be two related inconsistencies:
sandbox: read-onlystate does not always match the actual ability to write when--approve-for-meis used.I cannot determine whether these have the same root cause, but both were observed on the same installation during debugging.
What steps can reproduce the bug?
with a prompt asking Codex to create a small text file.
Observed result:
sandbox: read-onlyand the write is rejected.
Observed result:
sandbox-direct.txt is created successfullycodex exec --approve-for-me ...with a prompt asking Codex to create another small text file.
Observed result:
Observed result:
What is the expected behavior?
I would expect:
codex exec --sandbox workspace-writeto provide actual workspace write access when that mode is accepted by the CLI.In particular, if
--approve-for-meallows workspace writes, reporting only:sandbox: read-onlyis misleading because it does not describe the effective behavior observed by the user.
Ideally the CLI would expose the effective permission profile / approval mode clearly enough to explain why writes are allowed.
Additional information
Additional diagnostics performed during the investigation:
codex doctorreported the installation as consistent.doctorwarning was thatrg.execould not be found.Get-AppxPackage OpenAI.Codexreported:CodexSandboxUserscontained the secondary Windows user and both sandbox users.Direct low-level codex sandbox --permission-profile ":workspace"execution successfully wrote files, indicating that the restricted-token sandbox itself was functional.During early debugging there was also an old manually copied Codex CLI at:
D:\Tools\codex\codex.exeand
CODEX_CLI_PATHinitially pointed to it.That was corrected so that the automation used the current CLI installed under the secondary user's
%LOCALAPPDATA%\OpenAI\Codex\bin\...directory.After correcting the executable path, the end-to-end automation still required switching from:
to:
--approve-for-mebefore file modification worked reliably.
The old manually copied CLI was subsequently removed.
I did not change ownership or ACLs on
C:\Program Files\WindowsApps.I also tested the primary Windows user separately. On that account,
workspace-writewas able to create a file, although the first patch attempt failed before a later retry succeeded. This suggests the behavior may depend on per-user Codex/Desktop sandbox state rather than only on the machine-wide Store package.Related issue:
#35349 appears very similar with respect to the Codex Desktop "Windows setup incomplete" retry loop. My additional data point is Windows 10, a secondary local Windows user, and the CLI comparison showing that
:workspaceand--approve-for-mecan write while the displayed sandbox state remainsread-only._This report was prepared with assistance from ChatGPT based on a real, interactive debugging session with a human user. All reproduction steps, command outputs, and observations above come from actual testing on the affected Windows installation._
Update after further investigation
I found an important detail that changes the diagnosis of the
read-onlybehavior described in this report.In Codex Desktop, under Configuration → Agent defaults → Sandbox settings, the selected profile was set to Read only. After changing this setting to Workspace write, the app also exposed the Allow network access option for that sandbox mode.
I then repeated the filesystem test without changing Windows permissions, ACLs, UAC settings, the Codex installation, or the executable.
The test was performed under both Windows user accounts involved in the original investigation, including the dedicated non-primary account.
In both cases Codex reported:
sandbox: workspace-writeand successfully:
No unrelated workspace files were modified.
This means that the previous
read-onlyexecution was not caused by Windows filesystem permissions, WindowsApps ACLs, the secondary Windows user account, or an inability of the sandbox itself to write to the workspace.The Desktop Sandbox settings selection was controlling the effective sandbox mode.
There is still a UX/discoverability aspect worth noting: during troubleshooting,
codex doctorreported a restricted filesystem sandbox and the CLI/Desktop behavior made the problem look like a failed Windows sandbox setup or permissions problem. The Desktop sandbox mode setting was not obvious as the source of the effectiveread-onlystate.Therefore I would revise the original diagnosis as follows:
workspace-writeworks correctly on this Windows 10 system once selected in Codex Desktop.Separately, the earlier Windows setup/UAC behavior observed during installation may still be relevant, but I can no longer claim that it was the cause of the workspace being read-only.
I am leaving the issue open for maintainers to decide whether the remaining configuration/discoverability behavior is considered a bug or expected behavior.
_This update was drafted with ChatGPT based on troubleshooting and tests performed by a real user on the affected machine._
Windows 11 Pro 10.0.26200
OpenAI.Codex 26.814.5167.0
Containers-DisposableClientVM: Enabled
VirtualMachinePlatform: Enabled
Repair and Reset completed successfully (AppX registration result 0x0)
MacType fully exited; no subsequent CodeIntegrity events
After approving Windows setup, the app immediately shows “Windows setup incomplete”.