fix(merger): retry on non-FF ref-advance instead of failing the task (FN-5576)

When the squash commit was built off a stale integration tip, the FF guard
in advanceIntegrationBranchRef refused the swap with reason
`non-fast-forward-advance` — but the caller only mapped `concurrent-advance`
to IntegrationBranchConcurrentAdvanceError, so the non-FF case fell through
as a plain Error and failed the task. Both reasons share a root cause
(integration moved during the merge window), so they now share the
FN-4500/FN-5083 rebind/retry path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-23 19:56:37 -07:00
parent d7aec5d101
commit 0c0839eeb6
2 changed files with 15 additions and 1 deletions

View File

@@ -9808,7 +9808,14 @@ export async function aiMergeTask(
audit,
});
if (!advanceResult.advanced) {
if (advanceResult.reason === "concurrent-advance") {
// `non-fast-forward-advance` has the same root cause as
// `concurrent-advance` — integration moved during the merge window,
// here detected by ancestry rather than CAS old-value mismatch —
// so route it through the same rebind/retry path (FN-5576).
if (
advanceResult.reason === "concurrent-advance"
|| advanceResult.reason === "non-fast-forward-advance"
) {
throw new IntegrationBranchConcurrentAdvanceError({
integrationBranch,
expectedCurrentSha,