From 775c2906602ccede7c0abc03a86c9e5b9a37759f Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 18 Mar 2026 18:10:30 +0000 Subject: [PATCH] fix: update review-poll.sh approval injection to include merge commands The APPROVE injection previously told the dev-agent to write PHASE:done and let the orchestrator merge. Now the dev-agent merges directly, so the injection includes the full merge + issue-close curl commands matching the pattern already in the dev-agent.sh prompt. Co-Authored-By: Claude Sonnet 4.6 --- review/review-poll.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/review/review-poll.sh b/review/review-poll.sh index abd9aed..39bd450 100755 --- a/review/review-poll.sh +++ b/review/review-poll.sh @@ -128,8 +128,24 @@ inject_review_into_dev_session() { local inject_msg="" if [ "${verdict}" = "APPROVE" ]; then inject_msg="Approved! PR #${pr_num} has been approved by the reviewer. -Write PHASE:done to the phase file — the orchestrator will handle the merge: - echo \"PHASE:done\" > \"${phase_file}\"" +Merge the PR and close the issue, then signal done: + +curl -sf -X POST \\ + -H \"Authorization: token \$CODEBERG_TOKEN\" \\ + -H 'Content-Type: application/json' \\ + \"${API_BASE}/pulls/${pr_num}/merge\" \\ + -d '{\"Do\":\"merge\",\"delete_branch_after_merge\":true}' + +curl -sf -X PATCH \\ + -H \"Authorization: token \$CODEBERG_TOKEN\" \\ + -H 'Content-Type: application/json' \\ + \"${API_BASE}/issues/${issue_num}\" \\ + -d '{\"state\":\"closed\"}' + +echo \"PHASE:done\" > \"${phase_file}\" + +If merge fails due to conflicts, rebase first then retry. +If merge repeatedly fails, write PHASE:needs_human." elif [ "${verdict}" = "REQUEST_CHANGES" ] || [ "${verdict}" = "DISCUSS" ]; then inject_msg="Review: ${verdict} on PR #${pr_num}: