chore: gardener housekeeping 2026-03-26

This commit is contained in:
openhands 2026-03-26 18:14:35 +00:00
parent f32707ba65
commit 1f9b5e6444
11 changed files with 45 additions and 130 deletions

View file

@ -1,4 +1,4 @@
<!-- last-reviewed: 043bf0f0217aef3f319b844f1a1277acd6327a1c -->
<!-- last-reviewed: f32707ba659de278a3af434e3549fb8a8dce9d3a -->
# Dev Agent
**Role**: Implement issues autonomously — write code, push branches, address
@ -29,6 +29,10 @@ check so approved PRs get merged even while a dev-agent session is active.
**FORGE_REMOTE**: `dev-agent.sh` auto-detects which git remote corresponds to `FORGE_URL` by matching the remote's push URL hostname. This is exported as `FORGE_REMOTE` and used for all git push/pull/worktree operations. Defaults to `origin` if no match found. This ensures correct behaviour when the forge is local Forgejo (remote typically named `forgejo`) rather than Codeberg (`origin`).
**Session lock**: fd-based flock — released during idle phases (`awaiting_review`, `awaiting_ci`) so other agents can proceed; re-acquired before injecting the next prompt. This prevents the lock from blocking the whole factory while the dev session waits.
**Crash recovery**: on `PHASE:crashed` or non-zero exit, the worktree is **preserved** (not destroyed) for debugging. Location logged. Supervisor housekeeping removes stale crashed worktrees older than 24h.
**Lifecycle**: dev-poll.sh (`check_active dev`) → dev-agent.sh → tmux `dev-{project}-{issue}` → phase file
drives CI/review loop → merge + `mirror_push()` → close issue. On respawn after
`PHASE:escalate`, the stale phase file is cleared first so the session starts