diff --git a/hive-subagent-mcp/src/session.rs b/hive-subagent-mcp/src/session.rs index 9aef407f2..495405889 100644 --- a/hive-subagent-mcp/src/session.rs +++ b/hive-subagent-mcp/src/session.rs @@ -504,7 +504,7 @@ impl State { } /// Start every subagent run through this binary's entry wrapper, whose - /// `main` calls `run_cgroup::exec_entry` first: at `oom_score_adj` +1000 + /// `main` calls `run_cgroup::exec_entry` first: at `oom_score_adj` +900 /// always, and in its own cgroup under `cgroups` when there are any. #[must_use] pub fn entering_runs(mut self, cgroups: Option) -> Self { diff --git a/nix/agent-modules/agent-service.nix b/nix/agent-modules/agent-service.nix index 2b4b9f5b0..87145e246 100644 --- a/nix/agent-modules/agent-service.nix +++ b/nix/agent-modules/agent-service.nix @@ -561,8 +561,8 @@ in # A LOWER OOMScoreAdjust means LESS likely to be killed, so this # negative value puts the harness — and the agent's own `claude`, # which it spawns as a child and which therefore inherits the - # value — last in line under memory pressure, behind each subagent - # run (+1000) and bash task (0) (see ./mcp.nix). Losing a + # value — last in line under memory pressure, behind each bash task + # (+1000) and subagent run (+900) (see ./mcp.nix). Losing a # subagent costs one restartable task; losing this costs the # session that was supervising it. Not `-1000`, which would # exempt the harness entirely and leave the kernel with nothing diff --git a/nix/agent-modules/mcp.nix b/nix/agent-modules/mcp.nix index 434bec48c..0fe30ab6c 100644 --- a/nix/agent-modules/mcp.nix +++ b/nix/agent-modules/mcp.nix @@ -425,8 +425,8 @@ in Restart = "always"; RestartSec = 3; # The daemon runs each subagent run in its own `runs/-/` - # cgroup with `memory.oom.group=1` and `oom_score_adj` +1000, so an - # OOM kill takes one whole run, ahead of a bash task (0) and + # cgroup with `memory.oom.group=1` and `oom_score_adj` +900, so an + # OOM kill takes one whole run, after a bash task (+1000) and ahead of # `hive-agent` (-500). No `OOMScoreAdjust=` here: the daemon stays # at 0, and a unit value would also be the floor no run could go # below. The subgroup name is `DAEMON_SUBGROUP` in hive-agent-sock's