fix(FN-2356): improve pre-merge rebase abort observability

- Log explicit warning details when pre-merge `git rebase --abort` cleanup fails
- Keep merger fallback behavior intact so smart/AI merge still proceeds after rebase issues
- Add merger tests covering successful abort execution in the task worktree after rebase conflict
- Add regression test asserting abort failure warnings include stderr details while merge continues
This commit is contained in:
Fusion
2026-04-23 13:19:51 -07:00
committed by gsxdsm
parent 35823350b4
commit cab684877e
2 changed files with 113 additions and 1 deletions

View File

@@ -1905,7 +1905,11 @@ export async function aiMergeTask(
const msg = rebaseErr instanceof Error ? rebaseErr.message : String(rebaseErr);
mergerLog.warn(`${taskId}: pre-merge rebase failed (${msg}) — aborting rebase and falling through to smart/AI merge`);
if (worktreePath) {
await execAsync("git rebase --abort", { cwd: worktreePath }).catch(() => {});
try {
await execAsync("git rebase --abort", { cwd: worktreePath });
} catch (abortError: unknown) {
mergerLog.warn(`${taskId}: failed to abort pre-merge rebase: ${getCommandErrorMessage(abortError)}`);
}
}
}
}