Repository navigation
Description
Summary
On Windows Codex Desktop, apply_patch / fs-helper can repeatedly fail and show a Windows error dialog from codex-windows-sandbox-setup.exe when sandbox networking uses a local proxy.
The failure appears to be caused by the normal command-runner sandbox setup and the fs-helper computing different desired offline firewall proxy ports:
stored_ports=[7890], desired_ports=[]
stored_allow_local_binding=false, desired_allow_local_binding=false
When this mismatch is detected, the fs-helper tries to launch the sandbox setup helper. That launch fails with ShellExecuteExW error 1223, and Windows shows a dialog for codex-windows-sandbox-setup.exe saying the specified module cannot be found.
Environment
- OS: Windows 11, zh-CN locale
- Codex Desktop app:
OpenAI.Codex_26.616.3767.0_x64__2p2nqsd0c76g0 - Codex CLI/runtime reported by doctor:
0.142.0-alpha.1 - Sandbox mode: workspace-write / restricted filesystem
- Approval mode: auto approval / "approve for me"
- Sandbox network: enabled
- Network proxy required for this host to reach OpenAI services:
HTTP_PROXY=http://127.0.0.1:7890HTTPS_PROXY=http://127.0.0.1:7890ALL_PROXY=http://127.0.0.1:7890
setup_marker.jsonrecords:
{
"version": 5,
"offline_username": "CodexSandboxOffline",
"online_username": "CodexSandboxOnline",
"proxy_ports": [7890],
"allow_local_binding": false,
"read_roots": [],
"write_roots": []
}Symptoms
apply_patch fails with:
apply_patch verification failed: Failed to read file to update ...
fs sandbox helper failed with status exit code: 1:
windows sandbox failed:
orchestrator_helper_launch_canceled:
ShellExecuteExW failed to launch setup helper: 1223
Windows also displays a dialog for:
C:\Program Files\WindowsApps\OpenAI.Codex_26.616.3767.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe
with Chinese text equivalent to "The specified module could not be found."
Relevant sandbox log excerpts
Normal command-runner path works and can launch setup helper:
setup refresh: spawning C:\Program Files\WindowsApps\OpenAI.Codex_26.616.3767.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe (... payload_len=4024)
setup refresh: processed 3 write roots (read roots delegated); errors=[]
But the fs-helper path used by apply_patch computes empty desired proxy ports:
START: C:\Users\...\.codex\.sandbox-bin\codex.exe --codex-run-as-fs-helper
sandbox setup required: offline firewall settings changed (stored_ports=[7890], desired_ports=[], stored_allow_local_binding=false, desired_allow_local_binding=false)
This has recurred across restarts. Examples from the logs:
[2026-06-24 13:32:39.097 codex.exe] START: C:\Users\ASUS\.codex\.sandbox-bin\codex.exe --codex-run-as-fs-helper
[2026-06-24 13:32:39.120 codex.exe] sandbox setup required: offline firewall settings changed (stored_ports=[7890], desired_ports=[], stored_allow_local_binding=false, desired_allow_local_binding=false)
[2026-06-25 09:07:09.459 codex.exe] START: C:\Users\ASUS\.codex\.sandbox-bin\codex.exe --codex-run-as-fs-helper
[2026-06-25 09:07:09.478 codex.exe] sandbox setup required: offline firewall settings changed (stored_ports=[7890], desired_ports=[], stored_allow_local_binding=false, desired_allow_local_binding=false)
[2026-06-25 09:09:03.659 codex.exe] START: C:\Users\ASUS\.codex\.sandbox-bin\codex.exe --codex-run-as-fs-helper
[2026-06-25 09:09:03.682 codex.exe] sandbox setup required: offline firewall settings changed (stored_ports=[7890], desired_ports=[], stored_allow_local_binding=false, desired_allow_local_binding=false)
Reproduction pattern
- Use Windows Codex Desktop with workspace-write sandbox.
- Enable sandbox network access on a host that needs a local proxy to reach OpenAI services.
- Configure/inherit proxy env vars such as
HTTP_PROXY=http://127.0.0.1:7890. - Let normal sandbox command execution run; setup marker records
proxy_ports: [7890]. - Trigger
apply_patchon any workspace file. apply_patchinvokescodex.exe --codex-run-as-fs-helper.- The fs-helper computes
desired_ports=[], detects mismatch with marker[7890], attempts setup refresh, and fails withShellExecuteExW failed to launch setup helper: 1223plus a Windows dialog.
Expected behavior
The fs-helper should use the same proxy-port computation/configuration as the normal command-runner sandbox path, or should otherwise avoid launching setup refresh from the fs-helper when the mismatch is only due to proxy port propagation.
apply_patch should work under workspace-write sandbox with network proxy enabled.
Actual behavior
Normal sandbox commands work, but apply_patch fails because the fs-helper sees a proxy-port mismatch and cannot successfully launch codex-windows-sandbox-setup.exe.
Workarounds tested
The following did not permanently fix it:
- Restarting Codex Desktop.
- Adding
[network] proxy_url = 'http://127.0.0.1:7890'toconfig.toml. - Adding
[shell_environment_policy] inherit = "all". - Setting user-level
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY. - Setting WinHTTP proxy to
127.0.0.1:7890. - Replacing
.codex\.sandbox-bin\codex.exewith a wrapper. Codex refreshes this file back from its internal cache/source.
A temporary workaround that proves the mismatch is the trigger:
- Continuously rewriting
.codex\.sandbox\setup_marker.jsonsoproxy_portsis[]allowsapply_patchto succeed. - After that, logs show fs-helper starts without the
desired_portsmismatch line.
This is not a safe or acceptable long-term workaround, but it strongly suggests the bug is in fs-helper proxy port propagation/state comparison.
Additional notes
I searched for public reports using exact strings such as codex-windows-sandbox-setup.exe, orchestrator_helper_launch_canceled, ShellExecuteExW failed to launch setup helper, codex-run-as-fs-helper, and stored_ports desired_ports, but did not find an existing public issue.
Activity
github-actions commentedon Jun 25, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
zaijiayoujiayou-bot commentedon Jul 1, 2026
This Windows sandbox proxy regression is still not fixed in the current Desktop build.
Environment:
The same failure still reproduces with apply_patch:
The sandbox log still shows:
This appears to be the exact issue described in #29671 / #29938, but the fix does not seem to be included in the current Windows Desktop release. The app keeps launching codex-windows-sandbox-setup.exe during normal file edits, which causes repeated dialogs and breaks normal coding workflows.
Please prioritize shipping the preserve-proxy-settings fix to the Windows Desktop build. This is not a cosmetic issue; it makes normal code editing unreliable for users behind local proxies.
zaijiayoujiayou-bot commentedon Jul 3, 2026
Quick follow-up: this is still reproducible after the latest Desktop update.
Current environment:
apply_patchstill fails with:The sandbox log still shows the same proxy mismatch:
It looks like the Desktop package was updated, but the backend is still
codex-cli 0.142.5, and the preserve-proxy-settings fix still does not appear to be included.Could someone from the team confirm whether #29671 is expected to ship in a future Windows Desktop build? This issue still breaks normal file-editing workflows for users behind local proxies.
dobe233 commentedon Jul 5, 2026
I can reproduce the same issue on a newer Codex Windows build.
Environment
OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0codex-command-runner-0.142.5.exeworkspace-write[windows] sandbox = "elevated"127.0.0.1:6789Minimal reproduction
In a Codex Desktop Windows thread:
This succeeds.
Then:
This fails with:
Relevant sandbox state
setup_marker.jsonis generated with:But each
apply_patchfs-helper attempt logs:Additional checks
computer-use@openai-bundledand restarting did not fix the issue..codex/.sandbox/setup_marker.jsonand restarting did not fix it. The marker is regenerated withproxy_ports: [6789]because the shell environment still has the proxy vars.HKCU\Environment) does not contain these proxy variables.work/.This still looks like the normal command-runner sandbox setup and the
apply_patchfs-helper compute different desired proxy ports: normal shell setup records[6789], while fs-helper wants[], then tries to launch the elevated setup helper and fails withShellExecuteExW ... 1223.Yanmo0924 commentedon Sep 20, 2026
I can still reproduce this issue in the current latest Codex Desktop
Codex has been launched via the startup script that sets the proxy environment variables. When running four tasks simultaneously, the Codex Windows sandbox setup administrator permission window popped up multiple times in succession.
The sandbox logs show: stored_ports and desired_ports repeatedly switching between [7890] and [3128, 8081]. Within this window there are 16 firewall change checks, 23 marker missing checks, 1 user state incompatibility check, 12 configuration completion records, and 13 WFP success records. These are log entry counts, not popup counts.
The setup.exe signature has been verified as valid, with the signer being OpenAI OpCo, LLC. We want to investigate the proxy port requirements of different execution paths, as well as the shared state/lock coordination of parallel sandbox configurations; at present, no specific code defect can be confirmed.