Watch
0
0
Fork
You've already forked hyperhive
0

hive-agent-sock: kill what a subagent run leaves in its cgroup after it ends

This commit is contained in:
damocles 2026-11-18 13:32:26 +01:00 • committed by mara
commit 2689efebcf

View file

@ -515,7 +515,9 @@ impl State {
/// A new cgroup for one run of `name`; `None` without run cgroups, or
/// (logged) when creating it failed, and the run then stays in the
/// daemon's cgroup.
/// daemon's cgroup. Whatever a run left running in it (a tool child that
/// left claude's process group, which `interrupt`'s SIGINT never
/// reaches) is killed once the run has ended.
fn run_cgroup(&self, name: &str) -> Option<RunCgroup> {
let cgroups = self.run_cgroups.as_ref()?;
let n = self.run_seq.fetch_add(1, Ordering::Relaxed);
@ -523,6 +525,7 @@ impl State {
.create(&format!("{name}-{n}"))
.inspect_err(|e| tracing::warn!(name, error = %e, "subagent: run cgroup unavailable"))
.ok()
.map(RunCgroup::killing_leftovers)
}
/// `config` with its program started through the entry wrapper, at