fix: replace sleep+continue with exit 1 on stale patch to comply with AGENTS.md (#866)

AGENTS.md principle #1/#3 forbids fixed delays. When evolution.patch fails
the pre-flight --check, exit 1 lets the process supervisor handle restart
timing instead of a hardcoded sleep 300 busy-spin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 20:07:21 +00:00
parent 0fa80de0b9
commit 5a6df66541

View file

@ -190,9 +190,8 @@ while true; do
log "[2/7] Applying evolution patches…"
if ! (cd "$REPO_ROOT" && git apply --check "$PATCH_FILE"); then
log " ERROR: evolution.patch needs regeneration — see tools/push3-evolution/evolution.conf"
log " Skipping run (patch does not apply to current tree). Sleeping 300s before retry…"
sleep 300
continue
log " Exiting — patch does not apply to current tree. Restart daemon after regenerating the patch."
exit 1
fi
if (cd "$REPO_ROOT" && git apply "$PATCH_FILE"); then
PATCH_APPLIED=true