Windows: codex-windows-sandbox-setup.exe shows COM+ registry database error whenever apply_patch runs

Resolved 💬 8 comments Opened Jun 24, 2026 by MSCISMS Closed Jun 26, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

Version 26.616.81150 • Released Jun 24, 2026

What subscription do you have?

ChatGPT Plus

What platform is your computer?

win11x64

What issue are you seeing?

On Windows, Codex repeatedly shows a modal error from codex-windows-sandbox-setup.exe when apply_patch is used.

Error message:

<img width="826" height="259" alt="Image" src="https://github.com/user-attachments/assets/6a1e343e-ac6b-48dd-9868-66632d408e43" />

"The COM+ registry database detected a system error"

The file modification itself succeeds, but the modal appears multiple times during the apply_patch operation.

What steps can reproduce the bug?

Feedback ID: 019ef227-0b49-7521-b7f6-d0e90ac63cb0

What is the expected behavior?

apply_patch should modify the file without showing any Windows COM+ error dialog.

Additional information

OS: Windows 11
OS build: 10.0.26200.8655
Codex package: OpenAI.Codex_26.616.10790.0_x64__2p2nqsd0c76g0
Install source: Microsoft Store / OpenAI installer, which redirects to Microsoft Store
Workspace path: C:\Users\heman\Documents\Codex\2026-06-23\co

View original on GitHub ↗

8 Comments

github-actions[bot] contributor · 27 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #29771
  • #29418

Powered by Codex Action

Yodamt · 26 days ago

same on me and appears for version 26.616.81150 too.

zququ · 26 days ago

same

Amoystyle · 26 days ago

+1
same on me and appears for version 26.616.81150 too.

doublemarkpro · 25 days ago

same issue

mankonit · 25 days ago

Same here

zququ · 25 days ago
same

## Summary

Fixed apply_patch failures caused by Codex Windows sandbox repeatedly picking up a local
proxy port.

## Root Cause

Codex itself needed the proxy, but the sandbox helper also inherited proxy environment
variables:

HTTP_PROXY / HTTPS_PROXY / ALL_PROXY
http_proxy / https_proxy / all_proxy

That made Codex rewrite:

"proxy_ports": [4780]

in:

%USERPROFILE%\.codex\.sandbox\setup_marker.json

Then apply_patch triggered codex-windows-sandbox-setup.exe, which attempted to refresh Windows
sandbox/firewall state and produced the COM+ error.

The confusing part was that clearing setup_marker.json alone did not persist, because old Codex
processes still had the proxy variables in their process environment and wrote the port back.

## Fix

Keep Codex network proxy enabled, but prevent tool/sandbox shells from inheriting proxy env
vars:

[features]
network_proxy = true

[shell_environment_policy]
inherit = "all"
exclude = ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "http_proxy", "https_proxy", "all_proxy"]

Then restart all Codex/launcher processes so the new config is loaded.

After restart, clear the marker once:

"proxy_ports": []

## Verification

Confirmed:

HTTP_PROXY / HTTPS_PROXY / ALL_PROXY = empty
setup_marker.json proxy_ports = []
apply_patch add = success
apply_patch delete = success

So the proxy still works for Codex, but the Windows sandbox no longer tries to configure the
proxy port during apply_patch. (from AI)

MSCISMS · 25 days ago
> same ## Summary Fixed apply_patch failures caused by Codex Windows sandbox repeatedly picking up a local proxy port. ## Root Cause Codex itself needed the proxy, but the sandbox helper also inherited proxy environment variables: HTTP_PROXY / HTTPS_PROXY / ALL_PROXY http_proxy / https_proxy / all_proxy That made Codex rewrite: "proxy_ports": [4780] in: %USERPROFILE%.codex.sandbox\setup_marker.json Then apply_patch triggered codex-windows-sandbox-setup.exe, which attempted to refresh Windows sandbox/firewall state and produced the COM+ error. The confusing part was that clearing setup_marker.json alone did not persist, because old Codex processes still had the proxy variables in their process environment and wrote the port back. ## Fix Keep Codex network proxy enabled, but prevent tool/sandbox shells from inheriting proxy env vars: [features] network_proxy = true [shell_environment_policy] inherit = "all" exclude = ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "http_proxy", "https_proxy", "all_proxy"] Then restart all Codex/launcher processes so the new config is loaded. After restart, clear the marker once: "proxy_ports": [] ## Verification Confirmed: HTTP_PROXY / HTTPS_PROXY / ALL_PROXY = empty setup_marker.json proxy_ports = [] apply_patch add = success apply_patch delete = success So the proxy still works for Codex, but the Windows sandbox no longer tries to configure the proxy port during apply_patch. (from AI)

works for me, thx!