From 9445e36a1e77debf3f27f1749ba2809fd1f2b2ce Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 17 Mar 2026 09:38:08 +0000 Subject: [PATCH] fix: auto-close issues when dev-agent detects already_done Previously the agent unclaimed the issue but left it open, causing an infinite claim/refuse/unclaim loop on every poll cycle. --- dev/dev-agent.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index a40186d..475afd6 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -832,7 +832,14 @@ A maintainer should split this issue or add more detail to the spec." ${REASON} -This issue may be ready to close." +Closing as already implemented." + + # Close the issue to prevent retry loops + curl -sf -X PATCH \ + -H "Authorization: token ${CODEBERG_TOKEN}" \ + -H "Content-Type: application/json" \ + "${API}/issues/${ISSUE}" \ + -d '{"state":"closed"}' >/dev/null 2>&1 || true ;; *) log "unknown refusal status: ${REFUSAL_STATUS}"