codex - 💡(How to fix) Fix Windows app sandbox refresh fails with localhost proxy (127.0.0.1:7890), intermittently breaking apply_patch and shell_command [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17137Fetched 2026-04-09 08:01:59
View on GitHub
Comments
2
Participants
3
Timeline
10
Reactions
0
Timeline (top)
labeled ×5commented ×2unlabeled ×2closed ×1

Error Message

The failure happens before the tool logic itself runs. I have seen both apply_patch and shell_command fail with a sandbox setup error. The main error is: helper_firewall_rule_create_or_add_failed: SetRemoteAddresses failed: Error { code: HRESULT(0x80070057), message: "The parameter is incorrect." }

  • I also saw a secondary ACL-related sandbox error in the same area:

Fix Action

Fix / Workaround

The failure happens before the tool logic itself runs. I have seen both apply_patch and shell_command fail with a sandbox setup error.

This looks specifically related to the Windows sandbox firewall refresh, not to the patch content or the shell command content.

  1. On Windows, run Clash Verge Rev with TUN mode enabled and a local proxy listening on 127.0.0.1:7890.
  2. Export HTTP_PROXY and HTTPS_PROXY as http://127.0.0.1:7890.
  3. Start the Codex desktop app.
  4. In a normal workspace, run any sandboxed tool action, for example:
    • a shell_command like Get-ChildItem -LiteralPath .
    • or an apply_patch that updates a local file
  5. Codex logs a sandbox refresh mentioning the proxy port, for example: sandbox setup required: offline firewall settings changed (stored_ports=[], desired_ports=[7890], stored_allow_local_binding=false, desired_allow_local_binding=false)
  6. The action intermittently fails with: helper_firewall_rule_create_or_add_failed: SetRemoteAddresses failed: HRESULT(0x80070057)
  7. Retrying the exact same action often succeeds, which makes this look like sandbox setup instability rather than a deterministic tool/input failure.
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.325.3894.0

What subscription do you have?

Unknown / can provide if needed

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

On Windows, sandboxed tool execution intermittently fails when Codex sees local proxy env vars pointing at 127.0.0.1:7890. In my case this is Clash Verge Rev with TUN enabled, plus:

The failure happens before the tool logic itself runs. I have seen both apply_patch and shell_command fail with a sandbox setup error.

The main error is:

helper_firewall_rule_create_or_add_failed: SetRemoteAddresses failed: Error { code: HRESULT(0x80070057), message: "The parameter is incorrect." }

This looks specifically related to the Windows sandbox firewall refresh, not to the patch content or the shell command content.

What steps can reproduce the bug?

  1. On Windows, run Clash Verge Rev with TUN mode enabled and a local proxy listening on 127.0.0.1:7890.
  2. Export HTTP_PROXY and HTTPS_PROXY as http://127.0.0.1:7890.
  3. Start the Codex desktop app.
  4. In a normal workspace, run any sandboxed tool action, for example:
    • a shell_command like Get-ChildItem -LiteralPath .
    • or an apply_patch that updates a local file
  5. Codex logs a sandbox refresh mentioning the proxy port, for example: sandbox setup required: offline firewall settings changed (stored_ports=[], desired_ports=[7890], stored_allow_local_binding=false, desired_allow_local_binding=false)
  6. The action intermittently fails with: helper_firewall_rule_create_or_add_failed: SetRemoteAddresses failed: HRESULT(0x80070057)
  7. Retrying the exact same action often succeeds, which makes this look like sandbox setup instability rather than a deterministic tool/input failure.

What is the expected behavior?

Codex should handle localhost proxy settings cleanly on Windows. A local proxy such as 127.0.0.1:7890 should not cause sandbox refresh to fail, and sandboxed tool execution should not intermittently fail before the requested tool even runs.

Additional information

Additional observations:

  • I also saw a secondary ACL-related sandbox error in the same area: grant read ACE failed on C:\Program Files\WindowsApps\OpenAI.Codex_26.325.3894.0_x64__2p2nqsd0c76g0\app\resources for sandbox_group: SetNamedSecurityInfoW failed: 5 followed by: read ACL run had errors
  • That secondary issue appears to affect bundled tools under the app resources path. In one case, bundled rg.exe failed to start with Access is denied.
  • WinHTTP proxy on this machine is direct access; the proxy here is coming from environment variables, not from netsh winhttp.

Relevant local logs:

  • .codex.sandbox\sandbox.log around lines 113238, 113240, 113250, 113266, 113268, 113291
  • .codex\log\codex-tui.log around lines 16707 and 17435

If helpful I can provide a trimmed log excerpt, but the failure is already visible in the sandbox log with the 7890 port transition.

extent analysis

TL;DR

The issue can be resolved by adjusting the proxy settings or the sandbox configuration to handle the local proxy settings cleanly on Windows.

Guidance

  • Verify that the proxy settings are correctly configured and not causing conflicts with the sandbox setup.
  • Check the sandbox log files (.codex\.sandbox\sandbox.log) for errors related to the proxy port transition, specifically around lines 113238, 113240, 113250, 113266, 113268, and 113291.
  • Consider temporarily disabling the local proxy or adjusting the NO_PROXY environment variable to include the necessary exceptions.
  • Review the Codex app configuration and version (26.325.3894.0) to ensure it is compatible with the current Windows and proxy settings.

Example

No specific code snippet is provided, but the issue seems related to the environment variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY. Adjusting these variables or the sandbox configuration might resolve the issue.

Notes

The issue appears to be related to the interaction between the local proxy settings and the sandbox configuration. The error messages suggest a problem with the firewall rules and access control lists (ACLs). The fact that retrying the action often succeeds indicates that the issue might be related to a timing or synchronization problem.

Recommendation

Apply a workaround by adjusting the proxy settings or the sandbox configuration to handle the local proxy settings cleanly on Windows. This might involve disabling the local proxy, adjusting the NO_PROXY environment variable, or modifying the sandbox configuration to accommodate the proxy settings.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING