-
Notifications
You must be signed in to change notification settings - Fork 31
feat: optimize AI conflict resolution with concurrency and smarter context #547
Description
Summary
AI-powered conflict resolution during rover merge (and the upcoming rover rebase per #545) currently processes files sequentially and sends the full file content plus generic recent-commit history to the AI. This becomes slow and token-inefficient when a merge/rebase produces conflicts across many files or in large files.
This issue proposes two complementary optimizations:
- Resolve conflicted files in parallel instead of one at a time.
- Send only relevant context to the AI — both in terms of file content and git history — to reduce token usage and improve resolution accuracy.
Problem
Sequential processing is slow
When a merge or rebase produces conflicts in many files, each file is resolved in a serial loop: read file, call AI, write result, stage, move to next. Each AI call has network latency. With 10+ conflicted files, the total wall-clock time becomes significant even though the resolutions are independent of each other.
Full-file context wastes tokens and dilutes signal
Currently, the entire conflicted file is sent to the AI, even if the conflict is a small region in a 2,000-line file. Most of those lines are irrelevant noise. Similarly, the git context sent alongside is just the N most recent commits on the branch, which may have nothing to do with the lines in conflict.
Scope
This applies to both rover merge and rover rebase (once #545 is implemented), since both share the same conflict resolution logic.