Skip to content

fix: cherry-pick --continue fails after AI conflict resolution for modify/delete conflicts #1041

Description

@myakove

Bug Description

When a cherry-pick encounters a modify/delete conflict (file deleted in target branch but modified in the cherry-picked commit), the AI conflict resolution is triggered and completes successfully, but the subsequent git cherry-pick --continue fails with "error: no cherry-pick or revert in progress".

Root Cause

For modify/delete conflicts with a single file, when the AI resolves the conflict (by git adding or git rming the file), git automatically completes the cherry-pick since there are no remaining conflicts. By the time the code runs cherry-pick --continue, the cherry-pick has already been finalized by git, resulting in the error.

Evidence from Logs (PR RedHatQE/mtv-api-tests#349)

09:30:19 - Cherry-pick failed: CONFLICT (modify/delete): tools/bm-dns-setup.sh deleted in HEAD
09:30:19 - "Attempting AI conflict resolution with claude/claude-opus-4-6[1m]"
09:31:10 - "AI conflict resolution completed, finalizing cherry-pick"
09:31:11 - cherry-pick --continue failed: "error: no cherry-pick or revert in progress"

This happened for both target branches (v2.10 and v2.11).

Expected Behavior

After AI conflict resolution completes, the code should check whether the cherry-pick is still in progress before running cherry-pick --continue. If the cherry-pick was already auto-completed by git (because resolving the last conflict finalized it), the code should recognize this as a success and proceed with pushing the branch and creating the PR.

Deliverables

  • After AI conflict resolution, check if cherry-pick is still in progress before running --continue
  • If cherry-pick already completed (no cherry-pick in progress), treat as success
  • Add tests for modify/delete conflict resolution scenario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions