You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: Codex-spawned PowerShell crashes on startup and curl DNS lookup fails while normal terminal works #14221
Both commands should work the same way they do in my normal Windows terminal.
Actual
PowerShell fails during startup before Resolve-DnsName can run.
Observed errors included:
System.TypeInitializationException
InitialSessionState
GetSaferPolicy
AppLocker
System.ComponentModel.Win32Exception (126): The specified module could not be found
curl.exe failed with:
curl: (2) getaddrinfo() thread failed to start
A separate resolver test in the Codex-run environment also failed with getaddrinfo failed, while the same host resolves correctly in my normal terminal.
Important context
This appears to be specific to the Codex child-process/runtime environment, not general DNS failure on the machine.
My normal terminal can resolve and access the host correctly.
Environment
OS: Windows 11 / Windows build 10.0.26200.7922
Repo/runtime context: Codex terminal environment on Windows
powershell.exe exists
pwsh.exe exists
failure happens only from the Codex-run process environment
Notes
This reproduced again after a clean reinstall initially appeared to fix it, which suggests the problem is intermittent or environment-triggered rather than a one-time corrupted install.
Additional reproducible datapoint for the PowerShell-startup side of this issue:
On native Windows / codex-cli 0.153.4, the exact bundled pwsh works normally outside Codex sandboxing. Inside an elevated read-only Codex sandbox, native cmd.exe and where.exe also work, but minimal pwsh startup fails before the requested command with:
to the child environment fixed minimal PowerShell startup.
I then repeated a hermetic codex exec test with user config/rules ignored, read-only sandboxing, windows.sandbox="elevated", inherit="none", and only SystemRoot restored. PowerShell started and a single read-only scratch-file command succeeded.
No Full Access / unsandboxed fallback was required.
This does not address the DNS half of this issue, but it appears to be a concrete minimal workaround for the PowerShell InitialSessionState/GetSaferPolicy/126 failure.
Activity
github-actions commentedon Mar 10, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
rza255 commentedon Sep 28, 2026
Additional reproducible datapoint for the PowerShell-startup side of this issue:
On native Windows / codex-cli 0.153.4, the exact bundled pwsh works normally outside Codex sandboxing. Inside an elevated read-only Codex sandbox, native
cmd.exeandwhere.exealso work, but minimal pwsh startup fails before the requested command with:The sandbox environment was missing
SystemRoot.Adding only:
to the child environment fixed minimal PowerShell startup.
I then repeated a hermetic
codex exectest with user config/rules ignored, read-only sandboxing,windows.sandbox="elevated",inherit="none", and onlySystemRootrestored. PowerShell started and a single read-only scratch-file command succeeded.No Full Access / unsandboxed fallback was required.
This does not address the DNS half of this issue, but it appears to be a concrete minimal workaround for the PowerShell
InitialSessionState/GetSaferPolicy/126failure.