fix: feat: dev-agent merges its own PRs via non-admin Codeberg account (#172)

- phase-handler.sh: remove do_merge(); on APPROVAL inject exact API
  commands for agent to merge+close directly; PHASE:done now only
  does local cleanup (tmux, worktree, labels) — merge already done
- dev-agent.sh: update PHASE_PROTOCOL_INSTRUCTIONS — Approved means
  merge via API, close issue, then write PHASE:done
- dev-poll.sh: remove try_merge_or_rebase(); for approved+CI-green
  orphaned PRs, spawn dev-agent (recovery mode) to merge instead
- .env.example: document new token roles (CODEBERG_TOKEN = bot for
  push/PR/merge; REVIEW_BOT_TOKEN = human account for approvals)
- AGENTS.md: update token descriptions to match new roles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 17:59:36 +00:00
parent b38b2b13ae
commit f73d5f471e
5 changed files with 82 additions and 220 deletions

View file

@ -9,10 +9,14 @@ PRIMARY_BRANCH=main # main or master
# PROJECT_NAME=yourproject # optional — auto-derived from CODEBERG_REPO
# ── Auth tokens ───────────────────────────────────────────────────────────
# Codeberg API token (read from ~/.netrc by default, override here if needed)
# CODEBERG_TOKEN=
# Dev-agent token: push branches, create PRs, merge PRs.
# Use the dedicated bot account (e.g. factory_bot / disinto_dev).
# Branch protection: this account must be in the merge whitelist.
CODEBERG_TOKEN=
# Codeberg review bot token (separate account for formal reviews)
# Review-agent token: post review comments and submit formal approvals.
# Use the human/admin account (e.g. johba).
# Branch protection: this account must be in the approvals whitelist.
REVIEW_BOT_TOKEN=
# ── Woodpecker CI ─────────────────────────────────────────────────────────