fix: bug: dev-agent does not clean up branch/worktree on CI exhausted or block (#115) #118
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#118
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-115"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #115
Changes
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 saysReturns: 0=closed, 1=errorbut the function body has|| truemaking it always return 0. The comment is misleading but harmless since callers don't check the return value.info
dev/dev-agent.sh:579: Theif [ -n "$PR_NUMBER" ]guard is technically unnecessary — at that point in the flowPR_NUMBERis always set (an emptyPR_NUMBERwould have exited at line 533). Harmless defensive check.Verification
BRANCHandWORKTREEare initialized at lines 44–45 before any failure path, so the cleanup calls are safe.pr_closeuses directcurlconsistent withpr_createandpr_find_by_branchin the same file — not an inconsistency.FORGE_TOKENare explicitly exempt from vault dispatch requirements per AD-006.Verdict
APPROVE — Correctly adds missing cleanup for failure path; logic and patterns are sound
Reviewed at
e9a4fc7| AGENTS.mdAI Review: APPROVE — Correctly adds missing cleanup for failure path; logic and patterns are sound