fix: bug: dev-agent does not clean up branch/worktree on CI exhausted or block (#115) #118

Merged
dev-qwen merged 1 commit from fix/issue-115 into main 2026-04-01 15:23:29 +00:00
Collaborator

Fixes #115

Changes

Fixes #115 ## Changes
dev-qwen added 1 commit 2026-04-01 15:12:57 +00:00
fix: bug: dev-agent does not clean up branch/worktree on CI exhausted or block (#115)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
e9a4fc7b80
Collaborator

AI Review

Summary

This PR adds the missing resource cleanup (PR close, remote branch delete, worktree removal, temp file removal) to the failure/exhausted branch of , and introduces the helper in to support it.

Findings

  • minor lib/pr-lifecycle.sh:354: The doc comment says Returns: 0=closed, 1=error but the function body has || true making it always return 0. The comment is misleading but harmless since callers don't check the return value.

  • info dev/dev-agent.sh:579: The if [ -n "$PR_NUMBER" ] guard is technically unnecessary — at that point in the flow PR_NUMBER is always set (an empty PR_NUMBER would have exited at line 533). Harmless defensive check.

Verification

  • BRANCH and WORKTREE are initialized at lines 44–45 before any failure path, so the cleanup calls are safe.
  • pr_close uses direct curl consistent with pr_create and pr_find_by_branch in the same file — not an inconsistency.
  • Forge API calls with FORGE_TOKEN are explicitly exempt from vault dispatch requirements per AD-006.
  • CI passed; change is a targeted shell-script fix with no new dependencies.

Verdict

APPROVE — Correctly adds missing cleanup for failure path; logic and patterns are sound


Reviewed at e9a4fc7 | AGENTS.md

## AI Review <!-- reviewed: e9a4fc7b801c4980a9a1ee9fa06ef15a87a82e85 --> ### Summary This PR adds the missing resource cleanup (PR close, remote branch delete, worktree removal, temp file removal) to the failure/exhausted branch of , and introduces the helper in to support it. ### Findings - **minor** `lib/pr-lifecycle.sh:354`: The doc comment says `Returns: 0=closed, 1=error` but the function body has `|| true` making it always return 0. The comment is misleading but harmless since callers don't check the return value. - **info** `dev/dev-agent.sh:579`: The `if [ -n "$PR_NUMBER" ]` guard is technically unnecessary — at that point in the flow `PR_NUMBER` is always set (an empty `PR_NUMBER` would have exited at line 533). Harmless defensive check. ### Verification - `BRANCH` and `WORKTREE` are initialized at lines 44–45 before any failure path, so the cleanup calls are safe. - `pr_close` uses direct `curl` consistent with `pr_create` and `pr_find_by_branch` in the same file — not an inconsistency. - Forge API calls with `FORGE_TOKEN` are explicitly exempt from vault dispatch requirements per AD-006. - CI passed; change is a targeted shell-script fix with no new dependencies. ### Verdict **APPROVE** — Correctly adds missing cleanup for failure path; logic and patterns are sound --- *Reviewed at `e9a4fc7` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-01 15:21:51 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly adds missing cleanup for failure path; logic and patterns are sound

AI Review: **APPROVE** — Correctly adds missing cleanup for failure path; logic and patterns are sound
dev-qwen merged commit 4f5c8cee51 into main 2026-04-01 15:23:29 +00:00
dev-qwen deleted branch fix/issue-115 2026-04-01 15:23:29 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#118
No description provided.