Skip to content

windows: replace local pipe spawning#29984

Draft
anp-oai wants to merge 1 commit into
codex/pr3-05-command-preparationfrom
codex/pr3-06-raw-pipe-launcher
Draft

windows: replace local pipe spawning#29984
anp-oai wants to merge 1 commit into
codex/pr3-05-command-preparationfrom
codex/pr3-06-raw-pipe-launcher

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Intent

The Windows non-TTY Tokio launch path cannot guarantee Job Object assignment before a child executes. Unified exec needs a raw launcher that preserves pipe behavior while enforcing suspended creation, assignment, and resume.

Implementation

  • Add RAII stdin, stdout, and stderr pipes with inheritance cleared on parent-side handles.
  • Pass only child-side handles through PROC_THREAD_ATTRIBUTE_HANDLE_LIST.
  • Create the job before CreateProcessW, launch with CREATE_SUSPENDED, then assign and resume through SuspendedProcess.
  • Adapt blocking pipe readers and writers into the existing SpawnedProcess channels while preserving split stdout/stderr and tail draining.
  • Close the job before publishing root exit and terminate it for session termination or drop.
  • Add root-exit, explicit-termination, and session-drop descendant tests.

Manual validation

  • Ran just test -p codex-utils-pty on Linux.
  • Cross-compiled the codex-utils-pty Windows test target with cargo +1.95.0 check --target x86_64-pc-windows-msvc -p codex-utils-pty --tests.

Stack

1. job primitives2. local ConPTY3. restricted sessions4. elevated runner5. command preparation6. raw pipe launcher7. command parity

@anp-oai anp-oai force-pushed the codex/pr3-06-raw-pipe-launcher branch from 46dee87 to d891bf2 Compare June 25, 2026 04:26
@anp-oai anp-oai force-pushed the codex/pr3-05-command-preparation branch from 24d6479 to d050472 Compare June 25, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant