mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
Extend child commands with session and descriptor controls (#47604)
## What changed - Add `ProcessMode::NewSession`, null stdin, and opt-in Linux parent-death termination to the shared child command API. - Replace `DescriptorPolicy::StdioOnly` with `Explicit` and add `preserve_fds` to allow selected inheritable Unix descriptors alongside stdio. Preserve descriptor numbers without duplicating or closing the parent's descriptors, keeping POSIX record locks intact. - Support session creation and preserved descriptors in the native macOS backend, with a compatible fallback for high descriptor numbers rejected by native file actions. ## Testing Add regression coverage for process groups and sessions, descriptor preservation across native and executable-text launches, the last descriptor slot below the file limit, and retention of parent record locks. GitOrigin-RevId: 29ecd859d3b673da6ae6412cc06a32fa10d11346
This commit is contained in:
@@ -531,7 +531,7 @@ pub(crate) fn spawn_command(
|
||||
command.fallback(SpawnFallback::ReturnError);
|
||||
// macOS cannot receive passed fds with close-on-exec set atomically.
|
||||
#[cfg(target_os = "macos")]
|
||||
command.descriptor_policy(DescriptorPolicy::StdioOnly);
|
||||
command.descriptor_policy(DescriptorPolicy::Explicit);
|
||||
command.spawn().map_err(io_error)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user