Windows: Codex-spawned PowerShell crashes on startup and curl DNS lookup fails while normal terminal works

Open 💬 1 comment Opened Mar 10, 2026 by saichaithanya0705

Summary

Inside Codex on Windows, standard network commands fail even though the same commands work in my normal terminal.

Repro

Run inside Codex:

  • Resolve-DnsName chatgpt.com
  • curl.exe -I https://chatgpt.com

Expected

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗