Skip to content

windows: contain local ConPTY sessions#29980

Draft
anp-oai wants to merge 1 commit into
codex/pr3-01-job-primitivesfrom
codex/pr3-02-local-conpty
Draft

windows: contain local ConPTY sessions#29980
anp-oai wants to merge 1 commit into
codex/pr3-01-job-primitivesfrom
codex/pr3-02-local-conpty

Conversation

@anp-oai

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

Copy link
Copy Markdown
Collaborator

Intent

Local Windows ConPTY sessions must end the entire process tree when the root shell exits, the session is terminated, or the session handle is dropped. Descendants must not keep the session alive or escape after its reported completion.

Implementation

  • Create and configure the Job Object before CreateProcessW.
  • Spawn the ConPTY root suspended, assign it to the job, and only then resume its primary thread.
  • Make WinChild own JobProcess while cloned killers retain only the shared job controller.
  • Close the job before returning the root exit status and terminate the job for explicit kill paths.
  • Add focused exit-code, termination, natural-root-exit, and session-drop 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