Skip to content

Fix repeated automerge grace periods - #8

Merged
timkpaine merged 1 commit into
mainfrom
agent/fix-automerge-grace-loop
Aug 11, 2026
Merged

timkpaine merged 1 commit into
mainfrom
agent/fix-automerge-grace-loop

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Prevents eligible pull requests from hanging when GitHub has not exposed their automerge label event yet.

The grace-period calculation previously returned a fresh 10-second delay on every evaluation loop when issue-event history lacked the active label. That loop could outlive Cloudflare's background-processing window, so no merge was attempted unless another webhook retriggered evaluation.

This change records when the evaluation first observes the active label and uses that stable timestamp until GitHub event history becomes available. Label removal, eligibility rechecks, and SHA-pinned merges remain unchanged. It also adds regression coverage for delayed label-event visibility and documents the fallback behavior.

Validated with npm run check, npm run format:check, npm test (41 tests), and npm run build.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine marked this pull request as ready for review August 11, 2026 20:49
@timkpaine
timkpaine merged commit 66d62ca into main Aug 11, 2026
1 check passed
@timkpaine
timkpaine deleted the agent/fix-automerge-grace-loop branch August 11, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant