Codex spawn fix: bypass posix_spawnp's PATH search, exec yourself first on Linux
charliermarsh · x · 2026-11-25
charliermarsh details the Codex spawn optimization: the bug is in posixspawnp, which also searches PATH for the executable, so on macOS they call posixspawn directly. On Linux, since some setup isn't supported by posixspawn, they use it to spawn themselves, do the setup in the new process, then exec the command — counterintuitively adding an extra exec to make spawning faster.
More from coding & agent
- Why a general model for protein design: prompts replace chains of specialized tools — OpenAI · 2026-11-25
- Agent-based paper audits first flagged the DeepSeek issues in Palisade's chess study — jessi_cata · 2026-11-25
- Next.js Nights Berlin on Dec 2 to cover Go support, native routes, and agent-ready framework — evilrabbit_ · 2026-11-25
- OpenAI open-sources fix for Codex MCP server spawning reliability on macOS — charliermarsh · 2026-11-25
- Codex built its own Rust Command abstraction to stay on posix_spawn — charliermarsh · 2026-11-25
- Rust's std usually uses posix_spawnp under the hood — with exceptions — charliermarsh · 2026-11-25