Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/module-eval
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas b31db6c7d9 subagent, bash: run each subagent run and bash task in its own cgroup
hive-subagent-daemon and hive-bash-daemon are now delegated their cgroup
(Delegate=memory pids, DelegateSubgroup=daemon). At start each daemon
enables memory+pids below its unit and creates runs/ (subagent) or
tasks/ (bash). Each subagent run gets runs/<name>-<n>/ and each bash
task tasks/<id>/, both with memory.oom.group=1, and the daemon removes
the directory when the run ends. An OOM kill now takes one whole run
instead of one process out of the daemon's shared cgroup, and never the
daemon itself.

Subagent runs get oom_score_adj +1000; bash tasks and both daemons stay
at 0; the harness stays at -500. The unit-level OOMScoreAdjust=500 on
the subagent daemon goes: it was both the daemon's own score and a floor
no run below it could be lowered past.

Bash tasks enter their cgroup from the existing pre_exec hook, writing
to a cgroup.procs fd opened by the parent. hive-claude builds its
Command itself and exposes neither a pre_exec hook nor the child's pid,
so a subagent's claude (and an ACP agent's process) is started as the
daemon's own binary with the run's cgroup in its environment; main()
enters the cgroup, raises oom_score_adj and execs the real program, the
trampoline swarm-review-classifier already uses. Both enter before the
program executes, so nothing it forks starts outside the run's cgroup.

Without a delegated `daemon` leaf (tests, a dev shell) each daemon logs
one warning and runs everything in its own cgroup, as before.

The shared helper is hive-agent-sock's run_cgroup module, the crate
both daemons already use for what in-container plugins share.

Closes #5007
2026-10-13 12:25:27 +02:00
..
agent-forge-bao.nix agents: swap the agent's bao leaf in with one rename 2026-10-11 10:00:43 +02:00
agent-github-bao.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
agent-icon.nix nix: split module-eval into per-subsystem checks 2026-09-20 04:25:54 +02:00
agent-matrix.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
agent-memory.nix subagent, bash: run each subagent run and bash task in its own cgroup 2026-10-13 12:25:27 +02:00
agent-otel.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
agent-plugins.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
agent-queue-bao.nix swarm-logs: authenticate as the agent with its own queue secret 2026-10-13 08:38:05 +02:00
agent-runtime.nix agents: swap the agent's bao leaf in with one rename 2026-10-11 10:00:43 +02:00
agent-user.nix module-eval: agent-user test asserts the heal_own_dir form 2026-10-09 11:30:30 +02:00
bao-basics.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
bao-controller.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
bao-grants.nix swarm-logs-auth: check agent tokens on the log store's query route 2026-10-13 08:38:05 +02:00
bao-matrix-reader.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
bao-otel-collector.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
core-toggle.nix module-eval: the collector's metrics push path must be the vhost's gated push route 2026-10-13 09:38:43 +02:00
forge-placement.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
grafana.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
hive-otel.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
hive-tls.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
journald-severity.nix module-eval: assert the severity table once, not once per tier 2026-09-20 14:23:56 +02:00
lib.nix module-eval: set the hive-controller option only in tests that need a hive 2026-10-05 09:58:13 +02:00
matrix-core.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
name-guards.nix swarm: refuse swarm.hives keys that are not valid hive identifiers 2026-10-12 21:45:50 +02:00
nats-authelia.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
nats-tls.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
secret-publisher.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
shared.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
swarm-otel-core.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
swarm-otel-identity.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00
swarm-services-switch.nix module-eval: evaluate shared fixture configs once 2026-10-13 08:14:50 +02:00