mirror of
https://github.com/openai/codex.git
synced 2026-09-07 15:40:00 +00:00
## Why Rust falls back to `fork` when a macOS command combines a relative executable path with a working directory, due to a historical `posix_spawnp` issue. This can make local MCP server startup less reliable. ## What changed - Spawn relative macOS MCP executables directly with `posix_spawn`, preserving the configured path, `argv[0]`, working directory, environment, stdio, and process group. - Keep the existing launcher for `PATH` lookup and executable text files without a shebang. - Use one local child wrapper for legacy and 2026-07-28 protocol framing, with cancellation-safe waiting and cleanup that kills and reaps dropped children. ## Testing Add macOS regression coverage for relative scripts, argument and descriptor preservation, launch errors, cancelled waits, and cleanup after runtime shutdown. GitOrigin-RevId: 1cbc6b90aed6f67e0a38f551964d80496ebc4471