Skip to content

Fix merge-completion popup reliability#645

Merged
h0x91b merged 4 commits into
mainfrom
fix/dev3-pr-merged-detection
Jun 10, 2026
Merged

Fix merge-completion popup reliability#645
h0x91b merged 4 commits into
mainfrom
fix/dev3-pr-merged-detection

Conversation

@h0x91b

@h0x91b h0x91b commented Jun 10, 2026

Copy link
Copy Markdown
Owner

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:

  • Lost prompts: prompt state is persisted before display, and the precise-fingerprint check suppressed unanswered prompts permanently (app restart / undelivered push → popup gone forever; confirmed in live data). Permanent suppression now requires an explicit dismissal; unanswered reservations retry after 1h. The in-memory dedup Set became a Map with the same TTL.
  • Pruned remote branches: tasks whose remote branch was deleted 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 (trusted only when the PR's headRefOid equals local HEAD).
  • Dirty worktrees: the popup claims "no changes left" but never checked for uncommitted changes. The poller now skips dirty worktrees without reserving; the UI prompt requires zero uncommitted insertions/deletions.
  • Custom compare refs: the UI prompt fired for mergedByContent computed against any user-selected compare ref; it now requires the default base compare ref.
  • Wasted polling: dismissed tasks re-ran merge-tree/patch-id/gh checks on every 60s tick; suppression is now checked before expensive git/gh work.

Includes 16 new tests (poller, hook/UI gating, isBranchMergedViaGitHubPR against real temp repos), a decision record (decisions/066), and a small AGENTS.md clarification on the CANDIDATES response format.

h0x91b added 2 commits June 10, 2026 13:55
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.
@h0x91b h0x91b enabled auto-merge (squash) June 10, 2026 10:59
@h0x91b h0x91b merged commit 9fb4122 into main Jun 10, 2026
4 checks passed
@h0x91b h0x91b deleted the fix/dev3-pr-merged-detection branch June 10, 2026 11:24
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