Skip to content

feat(git): one-click "Let the agent resolve" for merge conflicts (#163) - #656

Merged
currentbits merged 2 commits into
mainfrom
coder/fork-one-click-let-the-agent-resolve-the-0c8138
Aug 22, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/fork-one-click-let-the-agent-resolve-the-0c8138

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #163.

The Git tab conflict card gets a primary Let the agent resolve button next to Retry merge. It reads the conflicted files out of the worktree, builds a resolve prompt, starts a turn on the same thread, and re-fires the merge once that turn finishes. Dismissing the card cancels the pending retry.

What changed

  • electron/worktrees.js — new conflictContext(): unmerged paths plus on-disk snippets, capped at 12 files / 16 KB per file / 48 KB total; binary files reported by name only.
  • src/conflictResolve.ts — new. Prompt builder, plus parseConflictFiles as a fallback that recovers the file list from the MERGE_CONFLICT: body when the context call fails.
  • src/components/AgentsPanel.tsx — the button, the busy/Resolving… states, and the working→done watcher that fires the merge retry.
  • electron/ipc.js, electron/preload.js, src/shared/ipcChannels.ts, src/shared/ipc.ts, src/useCoder.ts, src/App.tsx, src/devCoder.ts — the full IPC declaration for git:conflictContext. Preload is included, so the method is not undefined in a packaged build (the One IPC channel is declared in six places: generate the two thin clients from a channel table #623 trap).

Verification

  • npx tsc --noEmit — exit 0.
  • test/conflictResolve.test.ts + test/worktreeConflict.test.tsx — 9 tests, 9 pass.
  • electron/test/worktrees.test.js gains coverage for conflictContext but was not run here; it needs the full scripts/test-electron.js harness.

Worth a look during review

The merge retry is implicit: it fires when the resolve turn ends, whether or not the agent actually cleared the markers. A failed retry just re-shows the conflict card, so it is recoverable, but there is no "review then click" step in between.

Opened with allowOversize — 723 lines, but 363 of those are the two new test files.

🤖 Generated with Claude Code

Willem and others added 2 commits August 22, 2026 12:02
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 430a29c into main Aug 22, 2026
4 of 6 checks passed
@currentbits
currentbits deleted the coder/fork-one-click-let-the-agent-resolve-the-0c8138 branch October 3, 2026 16:07
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.

One-click 'let the agent resolve the merge conflict'

1 participant