Fix PR auto-merge: scanner detection, merge method config, trigger spam, install race#23
Merged
Merged
Conversation
…am, install race Fix 1: isClaudeCLI — resolve claude binary via which+EvalSymlinks at startup so versioned paths (e.g. ~/.local/share/claude/versions/2.1.77) are recognised. Fix 2: Merge method — new PRs start with MergeMethod="" (unset); ShouldAutoMerge blocks until configured. TUI auto-shows picker for new repos on add, persists choice via SetMergeMethod to daemon; per-repo preference stored in prs.json so future PRs from same repo inherit it. YOLO no longer requires completed checks. Fix 3: MergeTriggered flag — auto-merge fires once per eligible state; resets only if checks regress to failing/running, preventing /aviator merge spam. Fix 4: Install race — wait up to 2s for old csm-daemon to exit after launchctl unload before loading the new one, preventing stale state overwrites. Closes #22
- PR zoom panel now shows current merge method (e.g. '⎇ squash') or '⎇ unset' in the info line next to branch/commits/mergeable - M key (shift+m) opens the merge picker in config-only mode — persists the method to daemon without triggering an immediate gh pr merge - m key retains existing behavior: pick method + trigger immediate merge - Add MergeMethod field to client TrackedPR so it flows through to the TUI - Hints bar shows 'M set method' when a PR is selected
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.
Fixes #22
Summary
Four bugs preventing PR auto-merge from working correctly:
Scanner can't find Claude (versioned binary) —
isClaudeCLI()now resolves theclaudebinary viaexec.LookPath+filepath.EvalSymlinksat startup, matching versioned paths like.../claude/ver/<specific version>thatfilepath.Basereturns as a version string not"claude".Merge method unset blocks auto-merge, picker persists choice — New PRs start with
MergeMethod: ""andShouldAutoMergereturns false until configured. TUI auto-shows the merge picker when adding a PR from a new repo. Picker callsSetMergeMethodto persist the choice to the daemon; the daemon stores per-repo preferences so future PRs inherit the method. YOLO mode no longer requires completed checks (repos with no CI can merge).Auto-merge fires once, not every poll —
MergeTriggeredflag prevents re-firing/aviator merge(orgh pr merge --auto) on every 30s poll. Resets only if checks regress to failing/running.Install race condition —
csm-daemon installnow pollspgrepand waits up to 2s for the old process to exit afterlaunchctl unloadbefore starting the new one.Test plan
go test ./...indaemon/)go test ./...intui/)/aviator mergecomment posted at most once per eligible state