From 8c816d6e7b93727bc61eb5a2c6c8942f8fbbe0f6 Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 15:35:40 +0000 Subject: [PATCH] fix: dev-agent CI wait loop blocks forever for projects without CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wait-for-CI loop sleeps 30s × 60 iterations waiting for CI to report. Projects with WOODPECKER_REPO_ID=0 never get a status, so the agent times out after 30min without merging approved PRs. Now detects no-CI early and treats as success immediately. --- dev/dev-agent.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index bed2f4c..c60cfed 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -1069,6 +1069,15 @@ while [ "$REVIEW_ROUND" -lt "$MAX_REVIEW_ROUNDS" ]; do CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ "${API}/commits/${CURRENT_SHA}/status" | jq -r '.state // "unknown"') + # No CI configured — treat as success immediately + if [ "${WOODPECKER_REPO_ID:-2}" = "0" ] && { [ -z "$CI_STATE" ] || [ "$CI_STATE" = "pending" ] || [ "$CI_STATE" = "unknown" ]; }; then + log "no CI configured — skipping CI wait" + CI_STATE="success" + CI_DONE=true + CI_FIX_COUNT=0 + break + fi + if [ "$CI_STATE" = "success" ] || [ "$CI_STATE" = "failure" ] || [ "$CI_STATE" = "error" ]; then log "CI: ${CI_STATE}" CI_DONE=true