Codex built its own Rust Command abstraction to stay on posix_spawn
charliermarsh · x · 2026-11-25
The core engineering fix: the team wrote their own Command abstraction (like std::process::Command) that calls posixspawn directly in cases where the standard library would fall back to fork. Known fallback traps: preexec callbacks, and relative executables with a currentdir on macOS (a historical bug). The stakes are high — Codex spawns processes (shells, local MCP servers, hooks) millions of times per week.
Related event: Codex Builds Custom Rust Command Abstraction to Avoid Fork Fallback(2 posts)→
More from coding & agent
- 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
- Rust's std usually uses posix_spawnp under the hood — with exceptions — charliermarsh · 2026-11-25
- fork's copy-on-write still copies page tables, slowing big processes — charliermarsh · 2026-11-25
- Codex cuts process spawn time 800x to 0.25ms via direct posix_spawn — charliermarsh · 2026-11-25
- LiveKit ships Turn Detector v1.1, cutting turn-end detection latency 15–34% — alexcovo_eth · 2026-11-25