Repository navigation
fix(source-control): resolve delete/modify conflicts and complete merges from the panel - #35347
Conversation
[Medium impact] The PR appears safe to merge, with a non-blocking cross-host click issue and the earlier test gap. FindingsSummaryThe PR adds conflict-resolution actions and a way to finish a paused merge from the Source Control panel.
Reviews (6) · Last reviewed commit: "fix(source-control): run one conflict re..." · Reviewed by Greptile |
| await Promise.all(dirtyFileIds.map((fileId) => requestEditorFileSave({ fileId }))) | ||
| await stageRuntimeGitPath(context, filePath) |
There was a problem hiding this comment.
Conflict actions lack flow tests
The new tests cover action selection and Git commands, but not the editor-to-Git steps in handleResolveConflict. Add tests that check saving before staging, stopping when a save fails, and releasing the autosave hold when deletion or staging fails. Without these tests, a later change could stage old text or leave autosave paused.
Knowledge Base Used: Source control and reviews
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1b233e83-e919-4830-9ab0-18b5b7e21fe6
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 31-
src/main/git/source-control/commit-changes.tssrc/main/git/source-control/complete-merge-real-git.test.tssrc/main/git/status.tssrc/main/ipc/filesystem/filesystem-git-commit-handlers.tssrc/main/providers/git-provider-contract.tssrc/main/providers/local-git-provider.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/rpc/methods/git.tssrc/main/runtime/runtime-git-command-surface.tssrc/main/runtime/runtime-git-sync-commands.tssrc/preload/api/git-bridge.tssrc/preload/api/git-operation-api.tssrc/renderer/src/components/right-sidebar/source-control-too-many-changes-banner.test.tsxsrc/renderer/src/components/right-sidebar/source-control/commit/use-commit-action.tssrc/renderer/src/components/right-sidebar/source-control/commit/use-commit-flows.tssrc/renderer/src/components/right-sidebar/source-control/commit/use-entry-mutations.tssrc/renderer/src/components/right-sidebar/source-control/listing/conflict-label.tssrc/renderer/src/components/right-sidebar/source-control/listing/conflict-status-cards.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/content-status.test.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/content-status.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/entry-context-menu.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/section-action-buttons.test.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/uncommitted-entry-row.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsxsrc/renderer/src/components/right-sidebar/source-control/panel/panel-content.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/runtime-git-sync-client.tssrc/renderer/src/web/preload-api/web-git-api.tssrc/shared/source-control-entry-actions.test.tssrc/shared/source-control-entry-actions.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
4dad0be to
70ff45d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f5af25cc-29c2-48fe-b543-38156a6ad837
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 2-
src/renderer/src/components/right-sidebar/source-control/listing/uncommitted-entry-row.tsxsrc/renderer/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 1-
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
…ges from the panel
…ly after a completed merge
…ad unsaved views on retry
d768b38 to
2a2bf79
Compare
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
Upstream changed providers' getDiff arity (stablyai#34779), UpdaterState (stablyai#34104), DiffSectionBody props (stablyai#36577, stablyai#35004), combined diff list props (stablyai#36921), the native chat setting (stablyai#36110), recovery launches waiting for the prompt (stablyai#36210), conflict-resolution props (stablyai#35347) and row-opening params (stablyai#36301). The saved-event case for a write whose views all closed is dropped: upstream no longer notifies then (stablyai#31617), as decided for this rebase.
…lict by deletion Upstream stablyai#35347's keep_deletion quiesces and notifies only the repo owner; a folder workspace's open tab belongs to the folder key, so its autosave could write the deleted file back. Use the fork's ForOwners helpers like discard does.
ELI5
When a merge stopped on a conflict where one branch deleted a file and the other changed it, Orca showed the conflict but gave you nothing to click: no "keep it", no "delete it", and once you fixed it in a terminal, no button to finish the merge. Now each conflicted file has buttons to resolve it, and the "Merge in progress" card has a Complete merge button.
What Changed
Before: an unresolved conflict row had no actions (Stage is hidden for unresolved rows on purpose, and there was no way to accept a deletion). Once Git stopped reporting conflicts, the panel hid the commit box for any paused merge and offered only Abort merge, so a merge could only be finished from a terminal.
After:
getConflictResolutionsinsrc/shared/source-control-entry-actions.ts):git add. Before staging, any unsaved editor view of that file is saved, matched the same way autosave holds match views (pathMutationHoldKeys). Keep deletion removes the worktree copy, then runsgit add, which stages the removal. Autosave is held and editors are notified, like Discard. The row keeps its "Resolved locally" badge.completeMerge: it checks thatMERGE_HEADexists, then runsgit commit --no-edit --cleanup=strip. The merge commit gets Git's prepared message, without the# Conflicts:comment lines (the same result as saving the editor ingit merge --continue). It is exposed as IPCgit:completeMergeand runtime RPCgit.completeMerge, with a web-client binding. A failure shows a toast, because the commit box stays hidden while the merge is paused.Why
The root cause was in the Source Control panel. It had no resolution path for an unresolved conflict row, and it hid the commit area for every paused operation without offering anything that concludes one. So the GUI could start a delete/modify merge but only abort it. The fix adds the two missing steps at that owner and reuses Git's own semantics.
git addon an unmerged path is how Git marks a resolution, and--no-edituses the message Git already prepared. That avoids readingMERGE_MSGin the renderer or inventing a message.Alternatives considered:
Keep deletion composes the existing delete and stage ops instead of adding a
git rmop, so it works unchanged against older SSH/paired hosts. Only Complete merge needs a new method. On an older host it getsmethod_not_foundand shows "Completing a merge needs a newer Orca on this host. Update Orca on that host."Out of scope, as follow-ups:
Linked Issue
Fixes #28022
Linear: STA-10338
Visual Proof
Before (current
main, real scratch repo withUU both.txt+DU gone.txt): conflict rows have no actions, and the right-click menu has no resolution items.Before: after resolving and staging in a terminal, "Merge in progress" offers only Resolve with AI and Abort merge.
After: delete/modify. Keep file → "Resolved locally" → Complete merge → clean tree.
git logshowsMerge branch 'feature'with both parents.after-delete-modify-flow.mp4
After: both modified + deleted by us. Edit
both.txtin Orca's editor (left unsaved), Mark as resolved, Keep deletion ongone.txt, Complete merge. The merge commit contains the edited text,gone.txtis deleted, and the message has no# Conflicts:lines.after-both-modified-flow.mp4
Testing
Reproduced on current
mainin a hidden dev build against a real scratch repo (screenshots above). The same repo now goes through to a merge commit using only the GUI, in both flows (videos above). Checked withgit log --graphandgit log -1 --format=%B.Remote route: drove the runtime RPC directly against the dev build's runtime (the path SSH and paired hosts use).
git.completeMergewith unmerged files returns Git's own refusal.git.stageresolvesboth.txt;files.delete+git.stagekeeps the deletion ofgone.txt.git.completeMergethen succeeds, andgit.conflictOperationreportsunknown.git.completeMergewithmethod_not_found, the code the client maps to the update message.New real-git test
src/main/git/source-control/complete-merge-real-git.test.tscovers keep file, keep deletion, and refusing outside a merge even withcommit.templateset. It fails without--cleanup=stripand without the merge check.New
src/shared/source-control-entry-actions.test.tscovers the action-selection rule.Focused dependents (IPC, runtime git commands, RPC methods, provider, source-control renderer tests) and
check:code-quality:changedpass.Tested on macOS (local + runtime RPC). Linux and Windows are covered by CI. The change adds no platform-specific code: it uses Git CLI flags available since 2.25 and the existing delete/stage ops.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Codex and a Claude reviewer, four rounds. Fixed:
completeMergerefusing withoutMERGE_HEADAccepted as known limits:
#is stripped, as Git's editor flow doesboth_deletedrows keep the parser's pinned "status from XY alone" ruleAfter opening, from CodeRabbit and Greptile, fixed:
A pre-stage existence check for Keep file was tried and reverted: it blocked conflicted symlinks with missing targets. The remaining narrow race is visible as a staged deletion.
Agent skill upstream boundary
Notes
To try (needs blessing, new UI): build from worktree
~/orca/workspaces/orca/sta-10338-merge-conflict-gui(branchresolve-merge-conflicts-gui).In a scratch repo: branch
featuremodifiesgone.txt,maindeletes it, rungit merge featureonmain.Hover the
gone.txtrow under Conflicts and click Keep file (or Keep deletion; both are also in the right-click menu). Then click Complete merge and checkgit log -1.For a both-modified file: edit it in Orca, click Mark as resolved on the row, then Complete merge.
Security: no new path handling. Deletion goes through the existing authorized
fs:deletePath/files.deleteroutes.SSH/remote: IPC refuses SSH via
requireReachableGitRoute, and SSH/paired work goes through runtime RPC as forgit.commit. Older hosts get a clear message.Mobile:
git.completeMergeis not on the mobile allowlist. Mobile parity is a follow-up.Folder workspaces: no git, so no Source Control conflict UI.
Performance: a
MERGE_HEADfile probe per Complete merge click; nothing per render or per poll.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)