Skip to content

windows: add kill-on-close job process primitives#29979

Draft
anp-oai wants to merge 2 commits into
mainfrom
codex/pr3-01-job-primitives
Draft

windows: add kill-on-close job process primitives#29979
anp-oai wants to merge 2 commits into
mainfrom
codex/pr3-01-job-primitives

Conversation

@anp-oai

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

Copy link
Copy Markdown
Collaborator

Intent

Windows unified-exec launchers need a compatibility-safe primitive that guarantees a child cannot run user code before it belongs to a configured kill-on-close Job Object. This deliberately avoids the Windows 10-only PROC_THREAD_ATTRIBUTE_JOB_LIST path.

Implementation

  • Add shared KillOnCloseJob, SuspendedProcess, and JobProcess types in codex-utils-pty.
  • Share one non-inheritable kernel job handle across controller clones without duplicating it.
  • Terminate and wait for an uncommitted suspended child on every setup failure.
  • Require successful job assignment and an exact initial suspend count before returning a running process.
  • Add a private Win32 API seam with deterministic creation, configuration, assignment, and resume failure coverage.

Manual validation

  • 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

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