From 48c97a9b095c2665a1c8ada06b613803cc4ce994 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Apr 2026 07:29:01 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20bug:=20supervisor=20P1=20disk=20auto-fix?= =?UTF-8?q?=20uses=20`docker=20system=20prune=20-f`=20=E2=80=94=20too=20we?= =?UTF-8?q?ak=20for=20real=20disk=20pressure=20(#539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- formulas/run-supervisor.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/formulas/run-supervisor.toml b/formulas/run-supervisor.toml index ceaf340..63262d1 100644 --- a/formulas/run-supervisor.toml +++ b/formulas/run-supervisor.toml @@ -105,8 +105,13 @@ For each finding from the health assessment, decide and execute an action. sync && echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null 2>&1 || true **P1 Disk pressure:** - # Docker cleanup + # First pass: dangling only (cheap, safe) sudo docker system prune -f >/dev/null 2>&1 || true + # If still > 80%, escalate to all unused images (more aggressive but necessary) + _pct=$(df -h / | awk 'NR==2{print $5}' | tr -d '%') + if [ "${_pct:-0}" -gt 80 ]; then + sudo docker system prune -a -f >/dev/null 2>&1 || true + fi # Truncate logs > 10MB for f in "$FACTORY_ROOT"/{dev,review,supervisor,gardener,planner,predictor}/*.log; do [ -f "$f" ] && [ "$(du -k "$f" | cut -f1)" -gt 10240 ] && truncate -s 0 "$f"