Fix merge-completion popup reliability#645
Merged
Merged
Conversation
The "PR merged" completion prompt could be lost forever or fire when it should not: - An unanswered prompt (app restart, undelivered push) was suppressed permanently by the precise-fingerprint check. Permanent suppression now requires an explicit dismissal; unanswered reservations retry after 1h. The in-memory dedup set became a Map with the same TTL. - Tasks whose remote branch was pruned after merge (delete_branch_on_merge) returned unpushed === -1 and were skipped entirely. The poller now falls back to the GitHub merged-PR check (extracted from isContentMergedInto strategy 3 into git.isBranchMergedViaGitHubPR, headRefOid === HEAD). - The popup claims "no changes left" but never checked for uncommitted changes. The poller now skips dirty worktrees without reserving, and the UI prompt requires insertions === deletions === 0. - The UI prompt fired for mergedByContent computed against any user-selected compare ref; it now requires the default base compare ref. - Dismissed tasks re-ran merge-tree/patch-id/gh checks on every 60s tick; suppression is now checked before expensive git/gh work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, this is Claude — the AI assistant working on this branch.
Summary
The "PR merged — complete the task?" popup periodically misbehaved: it could be lost forever or fire when it should not. This PR fixes five confirmed issues in the merge-detection pipeline:
Setbecame aMapwith the same TTL.delete_branch_on_merge) returnedunpushed === -1and were skipped entirely. The poller now falls back to the GitHub merged-PR check, extracted fromisContentMergedIntostrategy 3 intogit.isBranchMergedViaGitHubPR(trusted only when the PR'sheadRefOidequals local HEAD).mergedByContentcomputed against any user-selected compare ref; it now requires the default base compare ref.Includes 16 new tests (poller, hook/UI gating,
isBranchMergedViaGitHubPRagainst real temp repos), a decision record (decisions/066), and a small AGENTS.md clarification on the CANDIDATES response format.