nikivdev/code · error

Sync auto-fix cleared raw conflicts for {} but the merge is

Error message

Sync auto-fix cleared raw conflicts for {} but the merge is still open. Validate the repo and finish the merge manually.

What it means

Thrown in src/sync.rs as the fallback of the 'merge still open' case: auto-fix cleared raw conflict markers, the merge remains un-finalized, and no repair packet path is available (repair_packet_path is None). Since there is no packet to resume from, the user is told to validate the repo and finish the merge manually.

Source

Thrown at src/sync.rs:4118

                            .record(stage, "merge validation pending after raw conflict repair");
                        bail!(
                            "Sync auto-fix cleared raw conflicts for {} but validation and merge finalization are still pending.\nRun `:sync repair --packet {}` or validate and finish the merge manually.",
                            remote_ref,
                            packet_path.display()
                        );
                    }
                    SyncRepairRouteOutcome::Unresolved => {}
                }
            }
            recorder.record(stage, "raw conflicts auto-resolved but merge not finalized");
            if let Some(packet_path) = repair_packet_path {
                bail!(
                    "Sync auto-fix cleared raw conflicts for {} but the merge is still open.\nRun `:sync repair --packet {}` or validate and finish the merge manually.",
                    remote_ref,
                    packet_path.display()
                );
            }
            bail!(
                "Sync auto-fix cleared raw conflicts for {} but the merge is still open. Validate the repo and finish the merge manually.",
                remote_ref
            );
        }
    }

    let conflicted_files = conflicted_files_in_repo(repo_root).unwrap_or_default();
    let repair_packet_path = if conflicted_files.is_empty() {
        None
    } else {
        write_sync_repair_packet(
            repo_root,
            SyncRepairKind::MergeConflict,
            &conflicted_files,
            &merge_detail,
            Some(&remote_ref),
            None,
            None,

View on GitHub (pinned to a747e741ae)

Solutions

  1. Check `git status` for the open merge; resolve any remaining conflicts and `git add` the files.
  2. Complete the merge with `git commit` (keeping the default merge message).
  3. Validate the repo (run tests/lint) to confirm the auto-resolution is correct; revert suspect hunks if not.
  4. Re-run sync once the merge is closed; consider updating the tool version so repair packets are produced.

Example fix

// before
f sync
// error: Sync auto-fix cleared raw conflicts for origin/main but the merge is still open...

// after
git status            # inspect open merge
git add -A            # after resolving anything left
git commit            # finalize merge
f sync
Defensive patterns

Strategy: validation

Validate before calling

import std::path::Path;
fn check_merge_open(repo_root: &Path) -> bool {
    repo_root.join(".git/MERGE_HEAD").exists()
}
// Run before sync; if true, finish or abort the merge first:
//   git status && git add -A && git commit   (or git merge --abort)

Try / catch

match sync::run(&repo_root, &cmd) {
    Err(e) if e.to_string().contains("merge is still open") => {
        eprintln!("No repair packet available. Finish manually: git add -A && git commit, then re-sync.");
    }
    other => other,
}

Prevention

When it happens

Trigger: Same route as error 908 — SyncRepairRouteOutcome::Unresolved with raw conflicts auto-resolved — but the repair packet was never created (repair_packet_path == None), so the packet-less bail variant fires with only the remote ref.

Common situations: Auto-fix ran without packet capture enabled or the packet creation failed; older tool version that doesn't emit packets; repair invoked through a path that skips packet recording.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/39abd057c4754a97. Report an issue: GitHub.