Windows Codex Desktop 26.616.4196.0 regression: apply_patch / fs-helper fails when global proxy env is set
What version of the Codex App are you using (From “About Codex” dialog)?
26.616.4196.0 (regression observed). Rolled back to 26.611.8604.0 and the issue no longer reproduces.
What subscription do you have?
ChatGPT Pro 10x
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
After upgrading Codex Desktop for Windows to 26.616.4196.0, apply_patch / fs-helper fails when Codex loads global proxy environment variables from C:\Users\<USER>\.codex\.env.
Normal sandbox shell commands can still run, but apply_patch triggers the Windows sandbox setup helper and fails.
The Windows dialog shows:
<img width="558" height="181" alt="Image" src="https://github.com/user-attachments/assets/a6afd420-0d6b-471c-963b-8ca7bcc757a8" />
C:\Program Files\WindowsApps\OpenAI.Codex_26.616.4196.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe
The specified module could not be found.
Sometimes the tool also reports:
orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223
Relevant sandbox log excerpt:
START: C:\Users\<USER>\.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)
The issue is reproducible on 26.616.4196.0 and is resolved by rolling back to 26.611.8604.0, with the same proxy environment still present.
What steps can reproduce the bug?
- Install Codex Desktop for Windows version 26.616.4196.0.
- Add proxy variables to
C:\Users\<USER>\.codex\.env:
HTTP_PROXY="http://127.0.0.1:7890"
HTTPS_PROXY="http://127.0.0.1:7890"
NO_PROXY="localhost,127.0.0.1,::1"
- Fully restart Codex Desktop.
- Open a local workspace with workspace-write sandbox enabled.
- Ask Codex to perform a small file edit that uses
apply_patch, for example creating a temporary file under.tmp. - Observe that normal sandbox shell commands may work, but
apply_patch/ fs-helper triggers the Windows sandbox setup helper and fails with the dialog:
The specified module could not be found.
- Roll back Codex Desktop to 26.611.8604.0.
- Repeat the same
apply_patchoperation with the same proxy env still present. - The operation succeeds on 26.611.8604.0.
What is the expected behavior?
apply_patch should work on Windows even when Codex global proxy environment variables are configured, just like normal sandbox shell commands do.
The fs-helper path should keep sandbox proxy/firewall desired state consistent with the normal command-runner path, and should not launch a setup helper that fails with:
The specified module could not be found.
If this proxy configuration is unsupported, Codex should show a clear actionable error instead of failing through the Windows sandbox setup helper.
Additional information
_No response_
12 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same here!
<img width="836" height="285" alt="Image" src="https://github.com/user-attachments/assets/38f33501-a968-4558-af8f-c5fdf69bddb0" />
This waring appears after I update the Codex App to the latest version(26.616.4196.0) this morning.
And I asked Codex how to deal with it. I tried to reboot my computer, reinstalled codex app from OpenAI official site. And I tried to repair it by Windows setting. But unfortunately, these all didn't work for me.
<img width="834" height="839" alt="Image" src="https://github.com/user-attachments/assets/ac37f62d-4a8f-4faa-8cbc-dc5ef704243c" />
Platform
Version: Windows 10 IoT Enterprise LTSC
Version Number: 21H2
Installation Date: 2024/8/23 OS
Internal Version: 19044.7417
@FalconIA Hey, dude, I updated the Codex to latest version just now(Version 26.616.41845 • Publishded at 2026.06.20).
And I let Codex check if this issue still exist, It seems disappeared.
<img width="1307" height="1086" alt="Image" src="https://github.com/user-attachments/assets/a5dc827d-0535-42b1-8625-38c3f6927124" />
I updated Codex as well, but the issue did not completely disappear on my machine.
In my environment, the About page shows
26.616.41845, and the Windows App package version is26.616.5445.0. However, with the following config:apply_patchstill failed with the same error:Based on the discussion in #29072 and my local testing, this does not seem to be determined by the app version alone. It appears to be related to the Windows
elevatedsandbox proxy/firewall state.On my machine, I found:
And my:
contains proxy settings using the same port:
When
proxy_portsinsetup_marker.jsonwas non-empty,apply_patchfailed consistently. After backing up the file and changing it to:apply_patchimmediately started working again.However, if I kept using:
some elevated sandbox setup/sync path could write the proxy port from
.codex\.envback intosetup_marker.json, after whichapply_patchfailed again.As a workaround, I changed the config to:
and restarted Codex. After that, even after triggering an escalated read of
setup_marker.json,proxy_portswas not written back, andapply_patchcould still update existing files successfully.So I do not think the issue is fully fixed for all environments yet. It seems to be related to this combination:
If it does not reproduce for someone after updating, it may be because their
proxy_portsis still empty, or because Codex has not yet triggered the elevated sandbox setup/sync path that refreshes this state.I think this should still be fixed on the Codex side. Switching to
unelevatedis only a temporary workaround, not an acceptable long-term solution, becauseelevatedis the recommended and stronger Windows sandbox mode. Users should not have to downgrade the sandbox implementation just to keepapply_patchworking when a proxy is configured.You need to empty the array of proxy_ports in 'setup
marker.json' first, otherwise, even if you set the sandbox to 'unelevated', the pop-up error will remain unresolved.
目前命令可以正常执行,但是会不断的跳弹窗。
<img width="1245" height="411" alt="Image" src="https://github.com/user-attachments/assets/cc9944a9-f02d-406b-9cf9-d06ee7eee16f" />
在命令执行成功之前还可能出现这样的提示:
<img width="1275" height="633" alt="Image" src="https://github.com/user-attachments/assets/16e7c27e-e3c6-45d5-a5df-33ec065cc5bf" />
写入工具刚才被 Windows 临时取消了,我现在重试一次。
still experiencing this issue with latest version.
I can reproduce what looks like the same Windows elevated sandbox/proxy oscillation issue.
TL;DR:
elevatedtounelevated; after reboot/restart, the repeated setup refreshes stopped.Environment:
Symptom:
...\OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe找不到指定的模块。Impact:
Evidence:
sandbox setup required: offline firewall settings changed (stored_ports=[10808], desired_ports=[], stored_allow_local_binding=false, desired_allow_local_binding=false)setup refresh: spawningentries and 51 proxy mismatch entries.windows-sandbox-rs/src/setup.rsderivingproxy_portsfrom proxy env vars.exec-server/src/fs_sandbox.rsusingFS_HELPER_ENV_ALLOWLIST = ["PATH", "TMPDIR", "TMP", "TEMP"], which strips HTTP_PROXY/HTTPS_PROXY/ALL_PROXY from fs-helper launches.[10808], but fs-helper contexts see no proxy, causing the elevated sandbox marker/firewall state to oscillate between[10808]and[].Workaround verified:
[windows] sandbox = "unelevated"Screenshots:
<img width="886" height="295" alt="Image" src="https://github.com/user-attachments/assets/42999596-35d5-47e4-872b-fc78f82dadf3" />
Expected:
codex-windows-sandbox-setup.exejust because proxy env is visible in one execution context and stripped in another.I am also using the latest version, and I just encountered this issue. I asked Codex to fix it myself
I reproduced the same proxy-state mismatch locally and prepared a minimal fix branch here:
https://github.com/openai/codex/compare/main...a-rookie-of-C-language:fix/windows-fs-helper-proxy-env
Root cause:
codex-rs/exec-server/src/fs_sandbox.rsbuilds the fs-helper environment from a narrow allowlist (PATH, temp vars). On Windows elevated sandbox, that strips proxy env such asHTTP_PROXY/HTTPS_PROXY/ALL_PROXYandCODEX_NETWORK_ALLOW_LOCAL_BINDINGbefore the fs-helper path goes through Windows sandbox setup validation. Normal command paths see the proxy port, but fs-helper seesdesired_ports=[], matching the observed log:The branch preserves those proxy-related env vars only on Windows for the fs-helper launch path, keeps the non-Windows helper env behavior unchanged, and adds a Windows unit test covering this propagation while still filtering secrets like
OPENAI_API_KEY.Validation on Windows:
Repo reject my pr because this repo only collaborators can create a pr
Adding another data point from Codex Windows App
26.616.6631.0that may help narrow the proxy/sandbox precedence issue.This looks like the same elevated Windows sandbox proxy-state mismatch, but with one extra twist: even after disabling Codex's network proxy feature, the running Codex App process can still drive
desired_ports=[10808]from inherited process-level proxy environment variables.Environment:
Relevant config:
Proxy env state after clearing User/Machine env vars:
setup_marker.jsonwas restored to:But the sandbox log still showed Codex trying to refresh WFP/firewall setup because the desired port list was derived as
[10808]:The setup helper was repeatedly spawned:
User-visible impact:
This caused repeated UAC prompts and made built-in
functions.apply_patchUpdate/Delete fail, while Add File could still work.What seems notable here:
[features.network_proxy].enabled = false.setup_marker.jsonto"proxy_ports": []is not stable until all Codex App processes are fully restarted and stop inheriting the old proxy env.Expected behavior:
If
[features.network_proxy].enabled = false, the Windows sandbox probably should not derivedesired_portsfrom inheritedHTTP_PROXY/HTTPS_PROXYprocess env, or Codex should at least log an explicit diagnostic explaining that this process env is still taking precedence over the feature flag.This may be the same oscillation described above, just observed in the opposite direction:
instead of:
version 26.616.51431 still encoutering this bug.