Skip to content

[codex] Preserve proxy state for filesystem sandbox helpers - #29671

Merged
iceweasel-oai merged 2 commits into
mainfrom
codex/preserve-fs-helper-proxy-state
Jun 23, 2026
Merged

iceweasel-oai merged 2 commits into
mainfrom
codex/preserve-fs-helper-proxy-state

Conversation

@iceweasel-oai

Copy link
Copy Markdown
Contributor

Why

Filesystem helpers intentionally run with a minimal environment that excludes proxy variables. After filesystem operations started using the Windows sandbox wrapper, the wrapper derived an empty proxy configuration from that helper environment and compared it with the persistent sandbox setup marker. When the marker contained proxy ports, every filesystem operation appeared to require a firewall update, which could launch elevated setup, show a UAC or loader dialog, and fail operations such as apply_patch with error 1223.

Filesystem helpers do not use network access, so they should preserve the proxy/firewall state established by normal sandboxed process launches.

What changed

  • Add an explicit Windows sandbox proxy-settings mode for reconciling or preserving persistent proxy state.
  • Use preserve mode for filesystem helpers while normal process launches continue to reconcile proxy settings from their environment.
  • Carry the selected proxy state consistently through setup validation, elevated setup, and non-elevated ACL refreshes.
  • Cover wrapper argument propagation and marker-derived proxy preservation.

Validation

  • cargo build -p codex-cli --bin codex
  • just test -p codex-windows-sandbox preserving_proxy_settings_uses_the_existing_marker
  • just test -p codex-windows-sandbox windows_wrapper_args_round_trip
  • just test -p codex-windows-sandbox setup_request_prefers_explicit_proxy_settings
  • just test -p codex-sandboxing transform_for_direct_spawn_windows
  • just test -p codex-exec-server fs_sandbox::tests
  • Ran the same sandboxed fs/writeFile reproduction against published 0.142.0-alpha.6 and the new CLI. The published CLI launched elevated setup and failed with ShellExecuteExW ... 1223; the new CLI completed without elevation.

Related to #28359.

@iceweasel-oai
iceweasel-oai force-pushed the codex/preserve-fs-helper-proxy-state branch from a9fa539 to 5367b6f Compare June 23, 2026 18:57
@iceweasel-oai
iceweasel-oai merged commit 18fe1d9 into main Jun 23, 2026
46 of 47 checks passed
@iceweasel-oai
iceweasel-oai deleted the codex/preserve-fs-helper-proxy-state branch June 23, 2026 19:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants