feat: add concurrency flag and optimize AI context for conflict resolution#469
feat: add concurrency flag and optimize AI context for conflict resolution#469dataforxyz wants to merge 8 commits intoendorhq:mainfrom
Conversation
Allow users to specify an AI agent with optional model for the merge command (e.g., rover merge 1 -a claude:sonnet). All agent constructors now accept an optional model parameter passed through to their CLI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new `rover rebase` command that rebases a task's branch onto the current branch. Includes AI-powered conflict resolution, automatic commit of uncommitted worktree changes, and -a/--agent flag support. Also adds rebaseBranch, abortRebase, and continueRebase methods to Git. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Stop silently swallowing errors in resolveMergeConflicts across all agent
implementations (claude, gemini, codex, cursor, qwen) so callers can
surface the actual failure reason. Also log errors in generateCommitMessage.
The resolve functions in merge.ts and rebase.ts now return
{ success, failureReason } instead of boolean, so the actual error
is surfaced in both spinner output and --json mode.
Closes endorhq#464
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve conflicted files in parallel during merge/rebase instead of sequentially. Defaults to 4 concurrent AI resolutions. Collects all failures instead of stopping at the first error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Send only relevant context (50 lines around each conflict region) and blame-based commit history instead of full file content. Adds --context-lines and --send-full-file flags to merge and rebase commands. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tream changes After rover rebase, task.baseCommit pointed to the original commit from worktree creation. This caused rover diff --base to include upstream changes in the diff. Now we update baseCommit to the current branch HEAD after a successful rebase. Fixes endorhq#476 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allow programmatic consumption of diff output by adding JSON format support to the `rover diff` command, consistent with other commands. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Thanks! I think this is an interesting approach! Just to split my comments:
-
Concurrency: I'm in general fine with it, the only comment I have is whether
--concurrencymight sound like a misplaced argument formergeandrebase; we might want to configure concurrency in general per agent/model, and these commands just use it if it's configured, or maybe use an envvar (although envvars are not easy to discover in general). -
Conflict context: although I think the idea is great in order to optimize the context that the agent sends to the model, I'm wondering if in order to fix some conflicts, the agent requires the whole context (e.g. I'm thinking about conflicts that somehow involve imports that might be out of the context and at the beginning of the file). In principle this makes a lot of sense, but it would be great to have a way to test it. We can add the optimization strategy as an opt-in functionality with a flag, so we can experiment with it.
This also needs to be rebased on top of #467 after it gets merged.
When truncateConflictContext() sends a truncated file to the AI, the AI returns only the visible portion. writeFileSync then overwrites the full file with this partial content, destroying omitted lines. Use region-based resolution: ask the AI to return only resolved conflict regions using ---REGION N--- markers, then splice them back into the original file. Falls back to full-file resolution if parsing fails. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
acbb45c to
212be1f
Compare
Added: Region-based conflict resolution to prevent file truncationProblem: When Fix: Instead of asking the AI to return the entire file, we now ask it to return only the resolved conflict regions using Changes:
|
Summary
--concurrencyflag for parallel conflict resolution during merge/rebaseStacked on #467 and #462.
Test plan
pnpm testto verify all tests pass--concurrencyflag🤖 Generated with Claude Code