Skip to main content

Module subprocess

Module subprocess 

Source
Expand description

Shared subprocess-tracking helper for CliAdapter implementations.

Every adapter that shells out to a CLI tool via std::process::Command (Claude Code, Copilot, Codex, …) needs the same thing: know the PID of whatever child is currently running so CliAdapter::kill_in_flight can reach it during shutdown, instead of leaving it orphaned when the listener process exits out from under it. TrackedSubprocess is that logic, written once, so each adapter wires it in with one field and a one-line kill_in_flight override instead of duplicating PID-tracking per adapter.

Structs§

TrackedSubprocess
Tracks the PID of a subprocess for as long as it’s running, so it can be killed on demand from anywhere holding a reference to this struct.