From 423268115c28415f2cd81ffe8596a19faf7318a3 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 27 Mar 2026 15:03:54 +0000 Subject: [PATCH] fix: supervisor-poll.sh: migrate remaining FACTORY_ROOT log paths to DISINTO_LOG_DIR Fix 4 missed references in supervisor-poll.sh: - Log truncation loop (disk pressure) - Log rotation loop (>5MB) - Pipeline stall detection (DEV_LOG) - Dev-agent productivity check (DEV_LOG_FILE) Without this, container mode has broken log rotation and false p2 alerts. Co-Authored-By: Claude Opus 4.6 (1M context) --- supervisor/supervisor-poll.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/supervisor/supervisor-poll.sh b/supervisor/supervisor-poll.sh index 5e68f4a..1e83966 100755 --- a/supervisor/supervisor-poll.sh +++ b/supervisor/supervisor-poll.sh @@ -153,7 +153,7 @@ if [ "${DISK_PERCENT:-0}" -gt 80 ]; then sudo docker system prune -f >/dev/null 2>&1 && fixed "Docker prune" # Truncate logs >10MB - for logfile in "${FACTORY_ROOT}"/{dev,review,supervisor}/*.log; do + for logfile in "${DISINTO_LOG_DIR}"/{dev,review,supervisor}/*.log; do if [ -f "$logfile" ]; then SIZE_KB=$(du -k "$logfile" 2>/dev/null | cut -f1) if [ "${SIZE_KB:-0}" -gt 10240 ]; then @@ -210,7 +210,7 @@ if [ -n "$STALE_CLAUDES" ]; then fi # Rotate logs >5MB -for logfile in "${FACTORY_ROOT}"/{dev,review,supervisor}/*.log; do +for logfile in "${DISINTO_LOG_DIR}"/{dev,review,supervisor}/*.log; do if [ -f "$logfile" ]; then SIZE_KB=$(du -k "$logfile" 2>/dev/null | cut -f1) if [ "${SIZE_KB:-0}" -gt 5120 ]; then @@ -358,7 +358,7 @@ check_project() { IN_PROGRESS=$(forge_api GET "/issues?state=open&labels=in-progress&type=issues&limit=1" 2>/dev/null | jq -r 'length' 2>/dev/null || echo "0") if [ "${BACKLOG_COUNT:-0}" -gt 0 ] && [ "${IN_PROGRESS:-0}" -eq 0 ]; then - DEV_LOG="${FACTORY_ROOT}/dev/dev-agent.log" + DEV_LOG="${DISINTO_LOG_DIR}/dev/dev-agent.log" if [ -f "$DEV_LOG" ]; then LAST_LOG_EPOCH=$(stat -c %Y "$DEV_LOG" 2>/dev/null || echo 0) else @@ -379,7 +379,7 @@ check_project() { if [ "${CHECK_DEV_AGENT:-true}" = "true" ]; then status "P2: ${proj_name}: checking dev-agent productivity" - DEV_LOG_FILE="${FACTORY_ROOT}/dev/dev-agent.log" + DEV_LOG_FILE="${DISINTO_LOG_DIR}/dev/dev-agent.log" if [ -f "$DEV_LOG_FILE" ]; then RECENT_POLLS=$(tail -100 "$DEV_LOG_FILE" | grep "poll:" | tail -6) TOTAL_RECENT=$(echo "$RECENT_POLLS" | grep -c "." || true)