fix(entrypoint): ensure_writable bind-mounts + add log-cleanup (>2d)

- entrypoint.sh: chown → chmod a+rwX → fail-fast met diagnostiek voor
  AGENT_STATE_DIR en AGENT_LOG_DIR. Lost stille state.json permission
  denied op QNAP-share op (NAS-ACL blokkeert chown vanuit container).
- bin/log-cleanup.sh: nieuwe hard-delete >2d (env-tunable) naast de
  conservatievere rotate-logs.sh (gzip 24u, delete 30d).
- run-agent.sh: roept log-cleanup.sh aan bij startup en elke iteratie.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Madhura68 2026-05-05 16:18:10 +02:00
parent 135ae2c2a2
commit 847ba96870
3 changed files with 55 additions and 7 deletions

View file

@ -38,6 +38,7 @@ rm -f "${AGENT_STATE_DIR}/UNHEALTHY" "${AGENT_STATE_DIR}/TOKEN_EXPIRED"
# Log-rotation eenmaal aan het begin, daarna elke iteratie.
/opt/agent/bin/rotate-logs.sh || true
/opt/agent/bin/log-cleanup.sh || true
# ----- seed prompt ------------------------------------------------------
SEED_PROMPT='Pak de volgende job uit de Scrum4Me-queue en draai de queue leeg volgens de loop in /opt/agent/CLAUDE.md. Niet stoppen tussen jobs door. Sluit pas af zodra wait_for_job na de volledige block-time terugkomt zonder claim.'
@ -125,4 +126,5 @@ while true; do
fi
/opt/agent/bin/rotate-logs.sh || true
/opt/agent/bin/log-cleanup.sh || true
done