Automatically rebases all open PR branches onto the new main after each merge,
detecting conflicts early and pushing clean rebases silently.
- Add rebaseAndPush() and getBranchSHA() to SCM interface
- Implement rebase logic in GitHub SCM plugin with --force-with-lease
- Create MainBranchTracker to detect when main branch advances
- Integrate auto-rebase into lifecycle polling loop (30s cycle)
- Add rebase tracking fields to SessionMetadata
- Add pr.rebased, pr.rebase_conflict, pr.rebase_error event types
- Add rebase-conflicts default reaction (escalates after 30m)
- Skip rebasing when agent is actively processing
- Silent success for clean rebases, urgent notification for conflicts
Safety: uses execFile, --force-with-lease, dirty workspace checks, rollback on
push rejection, aborts on conflicts. All new metadata fields optional for
backwards compatibility.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>