From 613c6c12cb916c632b01e957d97bdaa2b93940da Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 14:25:00 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20dev/dev-agent.sh:334=20=E2=80=94=20'?= =?UTF-8?q?in-progress'=20label=20still=20passed=20as=20string=20name=20to?= =?UTF-8?q?=20POST=20/labels=20(#222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Look up IN_PROGRESS_LABEL_ID via the labels API (with hardcoded fallback) and pass the numeric ID to POST /issues/{id}/labels, matching the pattern already used for BACKLOG_LABEL_ID. Co-Authored-By: Claude Opus 4.6 (1M context) --- dev/dev-agent.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index 25de680..711f517 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -45,6 +45,11 @@ BACKLOG_LABEL_ID=$(codeberg_api GET "/labels" 2>/dev/null \ | jq -r '.[] | select(.name == "backlog") | .id' 2>/dev/null || true) BACKLOG_LABEL_ID="${BACKLOG_LABEL_ID:-1300815}" +# Same for "in-progress" label +IN_PROGRESS_LABEL_ID=$(codeberg_api GET "/labels" 2>/dev/null \ + | jq -r '.[] | select(.name == "in-progress") | .id' 2>/dev/null || true) +IN_PROGRESS_LABEL_ID="${IN_PROGRESS_LABEL_ID:-1300818}" + log() { printf '[%s] #%s %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')" "$ISSUE" "$*" >> "$LOGFILE" } @@ -343,7 +348,7 @@ curl -sf -X POST \ -H "Authorization: token ${CODEBERG_TOKEN}" \ -H "Content-Type: application/json" \ "${API}/issues/${ISSUE}/labels" \ - -d '{"labels":["in-progress"]}' >/dev/null 2>&1 || true + -d "{\"labels\":[${IN_PROGRESS_LABEL_ID}]}" >/dev/null 2>&1 || true curl -sf -X DELETE \ -H "Authorization: token ${CODEBERG_TOKEN}" \ From def1ba7814678cf2f345c3d8a5065e918598f96a Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 14:45:03 +0000 Subject: [PATCH 2/2] fix: use numeric IN_PROGRESS_LABEL_ID in DELETE calls (cleanup_labels and cleanup) Review caught that cleanup_labels() and cleanup() still used the string name 'in-progress' in DELETE /labels/ URL paths. Switched both to use ${IN_PROGRESS_LABEL_ID} so label removal actually works on abort/crash. Co-Authored-By: Claude Opus 4.6 (1M context) --- dev/dev-agent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index 711f517..63f58c7 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -124,7 +124,7 @@ cleanup_worktree() { cleanup_labels() { curl -sf -X DELETE \ -H "Authorization: token ${CODEBERG_TOKEN}" \ - "${API}/issues/${ISSUE}/labels/in-progress" >/dev/null 2>&1 || true + "${API}/issues/${ISSUE}/labels/${IN_PROGRESS_LABEL_ID}" >/dev/null 2>&1 || true } CLAIMED=false @@ -137,7 +137,7 @@ cleanup() { log "cleanup: unclaiming issue (no PR created)" curl -sf -X DELETE \ -H "Authorization: token ${CODEBERG_TOKEN}" \ - "${API}/issues/${ISSUE}/labels/in-progress" >/dev/null 2>&1 || true + "${API}/issues/${ISSUE}/labels/${IN_PROGRESS_LABEL_ID}" >/dev/null 2>&1 || true curl -sf -X POST \ -H "Authorization: token ${CODEBERG_TOKEN}" \ -H "Content-Type: application/json" \