From e47b1967c49bdbdf9fb00cbed53cc3b6f2aae327 Mon Sep 17 00:00:00 2001 From: johba Date: Fri, 20 Mar 2026 14:29:57 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20fix:=20phase=20handler=20CI=20poll=20use?= =?UTF-8?q?s=20stale=20SHA=20=E2=80=94=20re-fetch=20worktree=20HEAD=20each?= =?UTF-8?q?=20cycle=20(#370)=20(#380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #370 ## Changes Re-fetch CI_CURRENT_SHA from worktree HEAD on each CI poll cycle inside the awaiting_ci handler. Previously the SHA was captured once before the loop, causing stale-SHA polling when Claude pushed new commits mid-wait. Co-authored-by: openhands Reviewed-on: https://codeberg.org/johba/disinto/pulls/380 Reviewed-by: Disinto_bot --- dev/phase-handler.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/phase-handler.sh b/dev/phase-handler.sh index 6f05527..4935c83 100644 --- a/dev/phase-handler.sh +++ b/dev/phase-handler.sh @@ -182,6 +182,9 @@ Write PHASE:awaiting_review to the phase file, then stop and wait for review fee break fi + # Re-fetch HEAD — Claude may have pushed new commits since loop started + CI_CURRENT_SHA=$(git -C "${WORKTREE}" rev-parse HEAD 2>/dev/null || echo "$CI_CURRENT_SHA") + CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ "${API}/commits/${CI_CURRENT_SHA}/status" | jq -r '.state // "unknown"') if [ "$CI_STATE" = "success" ] || [ "$CI_STATE" = "failure" ] || [ "$CI_STATE" = "error" ]; then