openai/codex · error
separate stderr handle should be present
Error message
separate stderr handle should be present
What it means
Sanity guard in the non-TTY pipe spawn path: spawn_process_with_pipes was requested with StderrMode::Separate, so it must return a stderr read handle; the guard bails when that contract is violated (the pipe-spawning helper failed to allocate/return the separate stderr pipe handle).
Solutions
- Request a separate stderr pipe when starting the exec session instead of merging stderr into stdout; otherwise treat it as an internal bug and retry.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:114 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/9a45421e92fae741.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:114
let stdout_join = spawn_output_reader(pipe_handles.stdout_read, stdout_tx);
let Some(stderr_read) = pipe_handles.stderr_read else {
anyhow::bail!("separate stderr handle should be present");
};
let Some(stderr_tx) = stderr_tx else {
anyhow::bail!("separate stderr channel should be present");
};
let stderr_join = spawn_output_reader(stderr_read, stderr_tx);View on GitHub (pinned to 339751715c)