Skip to content

Offer Resolve with AI for paused merge, rebase, and cherry-pick - #28569

Merged
AmethystLiang merged 5 commits into
mainfrom
rebase-operation-flow
Oct 22, 2026
Merged

AmethystLiang merged 5 commits into
mainfrom
rebase-operation-flow

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​888 $\color{#cf222e}{\Huge{\mathbf{−}}}$​34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​854
Prod 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​640 $\color{#cf222e}{\Huge{\mathbf{−}}}$​201 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​439

Problem

When Git pauses a merge, rebase, or cherry-pick, Orca only showed 'Resolve with AI' while there were conflicted files. If every conflict was already fixed but the operation was still paused, there was no AI button to help finish it. The AI launch could also start while another Git command was still running.

Solution

For any paused merge, rebase, or cherry-pick, Orca now shows 'Resolve with AI' when AI actions are on, even with zero conflicts. The button and the launch are blocked while a Git operation is running or being aborted. If Git starts while the agent is being detected, the launch is rejected.

ELI5

Sometimes Git stops partway through a job and waits for you. Before, the AI helper only appeared when there were broken files. Now it also appears when Git is waiting with nothing left to fix. It stays off while Git is busy.

What Changed

  • Operation banner shows 'Resolve with AI' for merge, rebase, and cherry-pick when AI is enabled, including with zero conflicts.
  • The button is disabled during a running Git operation or an abort.
  • The source-control dialog, the launch runner, and the AI hook re-check the live running-operation state before launching.

Why

A paused operation with no conflicts left still needs a way forward. Checking live state avoids starting an agent against a repo that Git is still changing. The alternative, showing the button only when conflicts exist, is the old behavior that left users stuck.

Linked Issue

No GitHub issue is linked. 'Fixes #' is left blank, so this PR does not close an issue.

Visual Proof

TODO: attach before/after screenshots of the operation banner and the conflict card. The e2e spec writes rebase-running.png and rebase-recovery.png to test output, but they are not attached here.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Added: banner and status-card tests, a runner test, dialog tests, a hook test, and the e2e spec tests/e2e/source-control-operation-recovery.spec.ts. Pass status is not recorded in this description.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance.
TODO: confirm these. The change is renderer-only, and the Git operation state is read from the local store.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f93d5c18-37f3-4fcb-ae67-19feefc3644a
📥 Commits

Reviewing files that changed from the base of the PR and between 835ff34 and 0c7efa1.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 38
  • src/main/git/command-runner/git-exec-file.ts
  • src/main/git/git-worktree-mutation-state.test.ts
  • src/main/git/git-worktree-mutation-state.ts
  • src/main/ipc/filesystem/filesystem-git-status-handlers.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/runtime/runtime-git-api-contract.test.ts
  • src/main/runtime/runtime-git-command-surface.ts
  • src/main/runtime/runtime-git-status-commands.ts
  • src/preload/api/git-bridge.ts
  • src/preload/api/git-inspection-api.ts
  • src/renderer/src/components/right-sidebar/SourceControl.commit-drafts.test.ts
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.tsx
  • src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.test.ts
  • src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts
  • src/renderer/src/components/right-sidebar/source-control-recovery-admission.test.ts
  • src/renderer/src/components/right-sidebar/source-control-recovery-admission.ts
  • src/renderer/src/components/right-sidebar/source-control-too-many-changes-banner.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/ai/use-ai.operation-recovery.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts
  • src/renderer/src/components/right-sidebar/source-control/ai/use-conflict-recovery-composer.ts
  • src/renderer/src/components/right-sidebar/source-control/listing/conflict-status-cards.tsx
  • src/renderer/src/components/right-sidebar/source-control/listing/content-status.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/listing/content-status.tsx
  • src/renderer/src/components/right-sidebar/source-control/panel/dialog-layer.tsx
  • src/renderer/src/components/right-sidebar/source-control/panel/panel-content.tsx
  • src/renderer/src/components/right-sidebar/source-control/panel/panel-dialogs.tsx
  • src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts
  • src/renderer/src/components/right-sidebar/useSourceControlAgentActionStart.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/runtime-git-mutation-in-flight-client.test.ts
  • src/renderer/src/runtime/runtime-git-status-client.ts
  • src/renderer/src/web/preload-api/web-git-api.ts
  • src/renderer/src/web/preload-api/web-git-mutations.ts
  • src/shared/git-mutation-in-flight.ts
  • src/shared/source-control-conflict-prompts.ts
  • tests/e2e/source-control-operation-recovery.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The change tracks Git commands that can modify a worktree and exposes their in-flight status through local and runtime APIs. Conflict-recovery admission and agent starts use that status before opening the composer or launching an agent. Recovery prompts now cover known paused operations with no unmerged files. Sidebar controls display and disable “Resolve with AI” based on AI-action visibility, abort state, and recovery state. Tests cover mutation tracking, admission, prompts, controls, and an end-to-end rebase scenario.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 0c7ef

The change offers Resolve with AI for paused Git operations and guards launches against running Git work. No merge-blocking issue was identified.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the problem, solution, implementation, and added tests. However, it leaves the required issue link blank, leaves visual proof as TODO for a UI change, and does not record test… Add the linked issue under “Fixes #” or document the applicable maintainer exception. Attach before-and-after screenshots or a video. Record the results or CI coverage for lint, typecheck, tests, and build, and complete the remaining checkl…
Docstring Coverage Warning Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 39 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main user-facing change for paused merge, rebase, and cherry-pick operations.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, solution, implementation, and added tests. However, it leaves the required issue link blank, leaves visual proof as TODO for a UI change, and does not record test or build results.

Resolution

Add the linked issue under “Fixes #” or document the applicable maintainer exception. Attach before-and-after screenshots or a video. Record the results or CI coverage for lint, typecheck, tests, and build, and complete the remaining checklist items.

Full details: Docstring Coverage

Explanation

Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 39 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

A paused operation can need recovery after every conflict is staged, but the Resolve with AI action only appeared when unmerged paths remained. The operation banner now offers it whenever AI actions are visible and an operation is in progress.

Starting an AI conflict-resolution agent is also blocked while a Git operation is running. The composer, the banner and card buttons, and the agent launch itself check the running-operation state, so a launch that began during agent detection cannot start while Git is still running.
The previous gate scanned the host's process table and refused "Resolve with AI" whenever it could not prove no Git process was running. That refused recovery on older paired hosts, on Windows whenever any Git process ran anywhere on the machine, and while a paged `git reflog` or `git grep` was open in a terminal.

- The host tracks Orca's own mutating Git commands per worktree (including ones still queued) and reports them through `git.mutationInFlight`. Reads and fetch/push/ls-remote are not tracked.
- Recovery is refused only when the host reports that work. Older hosts without the method keep today's behavior.
- The gate applies only to launches from the paused-operation banner and conflict card, not every resolveConflicts launch, so the Checks panel's PR-conflict flow is unchanged.
- The agent prompt now tells the agent to stop if index.lock exists or another git command is running, which covers Git started outside Orca on every host. With no unmerged files, the prompt asks the agent to find why Git paused instead of listing zero conflicts.
- Cancel stale recovery checks and agent launches when their dialog or scope closes
- Guide rebase recovery agents to amend fixes after failed exec steps
@AmethystLiang
AmethystLiang merged commit f1189be into main Oct 22, 2026
49 checks passed
brennanb2025 added a commit that referenced this pull request Oct 23, 2026
Resolve conflicts with #31971 (paired host launch preferences) and #28569
(Resolve with AI): the + menu, new-agent shortcut and default-agent pick
use the host's disabled list and default together with the host chat
program answer; the Source Control dialog uses main's availability helper
over the PR's launchable agents. Main's new auto-start test lands its
detected agents in the store the dialog reads.
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