Summary
Enhance the auto cherry-pick feature to use the AI CLI to automatically resolve merge conflicts when they occur during cherry-pick operations.
Problem / Motivation
When auto cherry-pick encounters merge conflicts, it currently fails and posts a "Manual cherry-pick is needed" comment with manual instructions. This requires the user to manually resolve conflicts locally, which is time-consuming.
Requirements
- AI conflict resolution: When
git cherry-pick fails due to conflicts, invoke the AI CLI to resolve them
- Upstream-first strategy: The AI must prioritize upstream (target branch) changes first, then apply the current PR changes on top. This ensures the target branch's state is respected as the baseline
- No auto-verify for AI-resolved cherry-picks: When conflicts were resolved by AI, the resulting cherry-picked PR must NOT be automatically verified. The user must manually test and verify the cherry-pick is correct and working
- Fallback to manual: If AI fails to resolve conflicts, fall back to the current behavior (post manual cherry-pick instructions)
Implementation Notes
- The cherry-pick method is in
webhook_server/libs/handlers/runner_handler.py (method cherry_pick, line ~689)
- AI CLI wrapper is in
webhook_server/libs/ai_cli.py (call_ai_cli, get_ai_config)
- The
auto-verify-cherry-picked-prs config already exists in the schema and controls auto-verification
- The
_process_verified_for_update_or_new_pull_request method in pull_request_handler.py already checks auto_verify_cherry_picked_prs flag
- AI features config (
ai-features with ai-provider and ai-model) is required for this feature to work
- When AI resolves conflicts, the cherry-picked PR comment should indicate that conflicts were resolved by AI and manual verification is required
Behavior Matrix
| Scenario |
Cherry-pick PR auto-verified? |
Comment on PR |
| No conflicts |
Yes (existing behavior, respects auto-verify-cherry-picked-prs config) |
Standard cherry-pick success |
| Conflicts + AI resolved |
No (never auto-verify) |
AI resolved conflicts, manual verification required |
| Conflicts + AI failed |
N/A (no PR created) |
Manual cherry-pick instructions (existing behavior) |
| Conflicts + AI not configured |
N/A (no PR created) |
Manual cherry-pick instructions (existing behavior) |
Deliverables
Notes
- AI features config (
ai-features with ai-provider and ai-model) must be configured for this feature to activate
- Without AI config, behavior remains unchanged (manual cherry-pick instructions on conflict)
Summary
Enhance the auto cherry-pick feature to use the AI CLI to automatically resolve merge conflicts when they occur during cherry-pick operations.
Problem / Motivation
When auto cherry-pick encounters merge conflicts, it currently fails and posts a "Manual cherry-pick is needed" comment with manual instructions. This requires the user to manually resolve conflicts locally, which is time-consuming.
Requirements
git cherry-pickfails due to conflicts, invoke the AI CLI to resolve themImplementation Notes
webhook_server/libs/handlers/runner_handler.py(methodcherry_pick, line ~689)webhook_server/libs/ai_cli.py(call_ai_cli,get_ai_config)auto-verify-cherry-picked-prsconfig already exists in the schema and controls auto-verification_process_verified_for_update_or_new_pull_requestmethod inpull_request_handler.pyalready checksauto_verify_cherry_picked_prsflagai-featureswithai-providerandai-model) is required for this feature to workBehavior Matrix
auto-verify-cherry-picked-prsconfig)Deliverables
runner_handler.pyNotes
ai-featureswithai-providerandai-model) must be configured for this feature to activate