Agents can't take the machine down:
- Concurrency: at most 3 subagents (
max_parallel_agents) and 4 shell commands (max_parallel_commands) run at once across all agents; the rest wait their turn. At most 8 background agents can be alive (max_background_agents), and subagents can't start subagents, so there's no recursive fan-out. - Memory-aware starts: new subagents and commands wait while free memory is below
min_free_memory_mb(default 5% of RAM, at least 1 GB), then fail with a message telling the model to work sequentially. On macOS this uses the kernel's memory-pressure figure, not resident size. - Watchdog: if Chanto's child processes use more than
memory_limit_percentof RAM (default 70%), or the system is nearly out of memory, Chanto kills the largest one's process group. That's the runaway build or test, never Chanto itself, and the model is told why. On macOS it measures physical footprint, so compressed and swapped memory count. - Bounded output: command output kept in memory is capped (head and tail), so a command that floods output can't exhaust RAM.
- Disk space: below 2 GB free on the project's volume the model is told once and asked to clean up; below 256 MB, writes and commands that would add data are refused with the free space in the error (cleanup commands such as
rm,cargo cleanandgit cleanstill run), rather than failing halfway through a write on a full disk.
toml
[resources]
max_parallel_agents = 3
max_parallel_commands = 4
max_background_agents = 8
# min_free_memory_mb = 2048
memory_limit_percent = 70 # 0 = watchdog off