diff --git a/nix/agent-modules/memory-cap.nix b/nix/agent-modules/memory-cap.nix index fa8631653..9b1dc2c43 100644 --- a/nix/agent-modules/memory-cap.nix +++ b/nix/agent-modules/memory-cap.nix @@ -20,14 +20,11 @@ # `hive-agent` and `hive-subagent-daemon` spawn `claude` as a plain child, # which inherits it, so neither unit may set or unset it. # - `MemoryHigh=` on `hive-subagent-daemon` and on `hive-bash-daemon`, two -# thirds of the cap each, as generator drop-ins. The subagent daemon spawns -# nested `claude` sessions as plain children, so its cgroup already is the -# "all subagents" cgroup. The bash daemon's cgroup holds every bash task -# (`tasks//`), so a `cargo` or `nix build` storm throttles itself there -# before it reaches the container's `MemoryMax=`. `High`, not `Max`: past it -# the kernel reclaims hard and the work slows down, so the last third stays -# free for the agent's own turn, but a task that needs more still gets it when -# the container has memory to spare. +# thirds of the cap each, as generator drop-ins. Each daemon's cgroup holds +# its children (nested `claude` sessions, bash tasks), so a `cargo` or +# `nix build` storm throttles itself there before the container's +# `MemoryMax=`. `High`, not `Max`: past it the kernel reclaims hard and the +# work slows down, so the last third stays free for the agent's own turn. # # Tested by `checks.script-test-agent-memory-cap` and # `checks.module-eval-agent-memory`.