Watch
0
0
Fork
You've already forked hyperhive
0

agents: hand over the kept drop-in's cap, warn at boot without one

When hive-c0re can't read resource-limits.json and a limits drop-in
already exists, it keeps the drop-in, but it wrote no memory cap file. A
container whose runtime dir had no file yet (hive-c0re upgraded, /run
not cleared) then started with no heap ceiling and no subagent
MemoryHigh=, silently. `stage_limits` now writes the file on every
call: from the new limits, or from the last `MemoryMax=` in the kept
drop-in (`infinity` when it has none or can't be read).

A missing or malformed cap file at boot is no longer silent. The
generators run before the container's journal and an nspawn container
has no /dev/kmsg, so a oneshot `hyperhive-memory-cap-check.service`
logs a warning naming the path. The agent then runs with no JSC heap
ceiling and no subagent MemoryHigh=; the container's MemoryMax= still
applies.

module-eval-agent-memory gains a case pinning how the ceiling reaches
claude: `hive-agent` and `hive-subagent-daemon` neither set nor unset
BUN_JSC_forceRAMSize, both generators and the check unit are installed.

Part of #5081 (slice S0-2).
This commit is contained in:
atlas 2026-10-12 10:10:11 +02:00
commit 57955a6c53
6 changed files with 144 additions and 32 deletions

View file

@ -459,6 +459,11 @@ values from it: `BUN_JSC_forceRAMSize` (75%, claude-code's heap ceiling)
and `MemoryHigh=` on `hive-subagent-daemon` (two thirds). Neither is in the
agent's build, so a changed cap reaches them at the next container start
without a rebuild. A cap of `infinity` or a RAM percentage sets neither.
When hive-c0re keeps the last drop-in because it can't read the overrides
file, the file carries that drop-in's `MemoryMax=`. A missing or malformed
file sets neither value, and `hyperhive-memory-cap-check.service` logs a
warning naming the path in the container's journal at boot. The
container's `MemoryMax=` still applies.
The same drop-in carries `CPUWeight=` / `IOWeight=` from
`agentCpuWeight` / `agentIoWeight`. Those are a different kind of