fix(watchdog): close stale [main-red] issues on head-drift + CI recovery (internal#668) #1858
Reference in New Issue
Block a user
Delete Branch "agent-dev-b/core-1789-stale-issue-close-on-recovery"
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?
Summary
[main-red]issues when main force-pushes during the settling window (head-drift path), so force-pushes don't leave orphaned open issues.close_same_sha=Truekwarg onclose_open_red_issues_for_other_shas()enables this without affecting the green-path callers.Test plan
test_head_drift_closes_stale_issue_for_prior_sha: stubs force-push SHA_NEW before recheck; assertsPATCH /repos/owner/repo/issues/9is called.test_recovery_on_same_sha_closes_issue_filed_on_prior_tick: stubs CI recovery on same SHA; asserts PATCH close.Refs
🤖 Generated with Claude Code
[draft] fix(watchdog): close stale [main-red] issues on head-drift and CI-recoveryto fix(watchdog): close stale [main-red] issues on head-drift + CI recovery (internal#668)Clean fix with good test coverage.
"state": "success"in the inner status dict (line ~640) instead of"status": "success"like the other tests — functionally harmless since the outerstateis what matters, but consider aligning for consistency.APPROVED.
/qa-recheck
/security-recheck
LGTM — stale main-red cleanup is limited to head-drift and same-SHA recovery paths, with regression coverage for both cases.