Skip to content

Add a button to hand PR merge conflicts to the agent - #294

Merged
frenchie4111 merged 2 commits into
mainfrom
add-ask-agent-fix-merge
Aug 22, 2026
Merged

Add a button to hand PR merge conflicts to the agent#294
frenchie4111 merged 2 commits into
mainfrom
add-ask-agent-fix-merge

Conversation

@frenchie4111

Copy link
Copy Markdown
Collaborator

Summary

  • The PR pane already knows when GitHub reports a conflicting merge, but acting on it meant switching to the chat and typing the request. This adds a one-click handoff: an Ask the agent to fix conflicts button appears above the CI-notify checkbox when hasConflict === true on an open PR.
  • Clicking it injects a message naming the PR, branch, and base into that worktree's agent chat, reusing the existing deliverToWorktreeChat routing — so it wakes a slept chat tab the same way the CI-failure notifier does. It lands in the transcript as a labelled Ness · Merge conflicts card, not as something the user typed.
  • Deliberately a button rather than the standing opt-in CI failures get: a branch that conflicts with its base usually conflicts with every other in-flight branch too, so firing this automatically would put the whole workspace to work over one bad merge base.

Two things the message deliberately leaves out, both commented at buildMergeConflictMessage:

  • No file list. The local base ref is often stale, so a git merge-tree preview from Ness would name files the agent then finds clean — it has git and can see the real answer.
  • No merge-vs-rebase prescription. Plenty of repos keep linear history. The agent can read the convention off git log and CLAUDE.md, and Ness has no setting that records it (mergeStrategy is how a PR lands on main, which says nothing about how a branch syncs with its base).

Test plan

  • npm run typecheck clean
  • npx electron-vite build clean
  • npx vitest run — new merge-conflict-request.test.ts covers the sentinel round-trip (guards the merge-conflict automation source being registered, without which the chat would render it as a plain user turn) and that the PR number / branch / base / URL make it into the body
  • Not visually verified in a running app — the button only renders when GitHub reports a conflicting PR, which I couldn't stage locally. Worth a manual look on a real conflicted PR before merge: button appearance, the sending → "Asked the agent" → idle transition, and the chat card rendering.

🤖 Generated with Claude Code

frenchie4111 and others added 2 commits August 21, 2026 07:45
The PR pane already knows when GitHub reports a conflicting merge, but
resolving it meant switching to the chat and typing the request. This
adds a one-click handoff that injects the ask into the worktree's agent
chat, waking a slept tab the same way the CI-failure notifier does.

Deliberately a button rather than the standing opt-in CI failures get: a
branch that conflicts with its base usually conflicts with every other
in-flight branch too, so firing this automatically would put the whole
workspace to work over one bad merge base.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Plenty of repos keep linear history, so telling the agent to merge the
base branch in was wrong for half of them. The agent is sitting in the
repo and can read the convention off git log and CLAUDE.md, so name the
goal and let it pick.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@frenchie4111
frenchie4111 merged commit ae5b4ec into main Aug 22, 2026
1 check passed
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