Expand description
Whole-tree ownership of a spawned command (#1920).
A timeout or cancel has to end every process the command started, not just
the shell leader. On Unix callers already isolate the child in its own
process group, and killpg reaches every descendant. Windows has no such
group: Child::kill ends the shell alone, and a python - it started keeps
running detached — spinning a core for hours when its script loops.
A job object is the Windows equivalent. The child is spawned suspended,
assigned to a private job and only then resumed, so nothing it starts can
escape. TerminateJobObject ends the whole tree at once, and
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE ends it when lean-ctx itself dies before
it could clean up.
Structs§
- Process
Tree - The process tree of one spawned command. Create it with
ProcessTree::startright after spawning a command prepared byProcessTree::prepare. - Started
Shell - A started MCP shell: the process, its output, and what the caller has to show in front of the result, if anything.
Enums§
- Shell
Child - The shell of one MCP shell call, whoever its parent is.