Files
deepseek-harness/packages/subprocess
Yichen Jiang 9757224349 fix(subprocess): fence each signal against current process state
Review found the shared observation defeated the very fence it fed:
it carries the original PID-to-start-time pairing forward, so a
recycled PID still matches it and takes a signal meant for the process
that exited. Capturing it outside the per-member try also let one
failed read abort a whole teardown round, breaking the synchronous
host-exit contract, and an empty round paid a read for no members.

signalProcess now reads ProcessInspector.isAlive immediately before
delivering, from the narrowest per-identity source each platform
offers; signalMembers and waitForMembers return before capturing when
a round has no members. snapshot() keeps serving the readiness poll,
whose per-poll table read stays at one.

Windows enumerates Toolhelp32 lazily on the first tree question, so a
snapshot asked only for liveness — the 25 ms teardown poll — performs
no table walk at all.
2026-08-27 15:19:43 +08:00
..

description, kind
description kind
The subprocess group map: the shared child-process service and its local host provider, for users and maintainers navigating the group. package-group

subprocess/ — subprocess capability family

English | 中文

Summary

Every child process and terminal session the harness runs — bash commands, language servers, persistent shells, and out-of-process subagent backends — starts, observes, and terminates through one shared service (ctx.subprocess), with a local provider running them on the host machine. It is not a standalone product feature: the consuming capability seams decide what each process means, and command semantics, deadlines, and model-facing presentation stay with them. The group provides executable lookup, bounded output capture with spill recovery, whole-tree termination, and a scrubbed starting environment for every child.

Table of Contents


Packages

Package Role ctx key
subprocess Defines the child-process service: executable lookup, managed process spawns, and real terminal sessions ctx.subprocess
subprocess-local Runs those process and terminal spawns on the host machine registers on ctx.subprocess
win32-process Owns the shared Win32 bindings for restricted process creation, stdio, Job assignment, waits, and handle cleanup library — no ctx key

The service keeps process lifetime across consumer reloads; consumers own what a process means (a bash command, a language server) and every default that shapes one.



Dev Note

Working context for maintainers — click to expand

None.