pub trait TrackerHandle: Send + Sync {
// Required methods
fn assign_process(&self, pid: u32) -> Result<(), String>;
fn list_members(&self) -> Vec<TrackedProcess>;
fn kill_tree(&self);
fn kill_pid(&self, pid: u32) -> bool;
fn confidence(&self) -> TrackingConfidence;
}Expand description
Opaque per-agent handle returned by the tracker when we wrap a spawn.
Held inside AgentProcessRegistry for the lifetime of the pane;
dropped when the pane closes or the agent exits.
Required Methods§
Sourcefn assign_process(&self, pid: u32) -> Result<(), String>
fn assign_process(&self, pid: u32) -> Result<(), String>
Add a freshly-spawned process to the tracked tree. Called by the
controller immediately after tokio::process::Command::spawn.
Descendants created AFTER this call are caught automatically;
descendants created BEFORE (in the ~1ms race window) escape.
No-op in the stub impl — platforms without a real tracker
silently accept the PID and move on.
Sourcefn list_members(&self) -> Vec<TrackedProcess>
fn list_members(&self) -> Vec<TrackedProcess>
Enumerate the current members of this tracked tree.
Must be cheap enough to poll every ~2s. On Windows this is a
single Job Object query; on Linux it’s a read of cgroup.procs;
on macOS it’s a sysctl scan.
Sourcefn kill_pid(&self, pid: u32) -> bool
fn kill_pid(&self, pid: u32) -> bool
Terminate a single process by PID, if it’s a member of this tree.
Returns true if the PID was known and the kill was attempted.
Sourcefn confidence(&self) -> TrackingConfidence
fn confidence(&self) -> TrackingConfidence
Describes how confidently this platform tracks descendants. Surfaced to the UI so the user can tell when tracking is best-effort and escape-prone.