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.
Run `:sync repair --packet {}` or validate and finish the merge manually.

What it means

Thrown in src/sync.rs when auto-fix cleared raw conflict markers but the merge is still open (SyncRepairRouteOutcome::Unresolved fell through) and a repair packet path is available. Unlike error 907, validation wasn't merely pending — the merge itself remains un-finalized. The message includes the remote ref and packet path for resuming.

Source

Thrown at src/sync.rs:4112

                        sync_progressln!("Sync agent validated and finalized the merge");
                        recorder.record(stage, "sync agent validated and finalized merge");
                        return Ok(());
                    }
                    SyncRepairRouteOutcome::ValidationPending => {
                        recorder
                            .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,

View on GitHub (pinned to a747e741ae)

Solutions

  1. Resume with the packet: `:sync repair --packet <packet_path>` to complete the merge.
  2. Finish manually: `git status` to see the open merge, resolve/stage files, then `git commit` to close the merge.
  3. Validate the repo (tests/lint) to confirm the auto-fix produced a sound resolution.
  4. Re-run sync once the merge is finalized.

Example fix

// before
f sync
// error: ...merge is still open. Run `:sync repair --packet /tmp/packet-9.json`...

// after
:sync repair --packet /tmp/packet-9.json
git status && git commit   # manual fallback
f sync
Defensive patterns

Strategy: try-catch

Validate before calling

import std::path::Path;
fn merge_open(repo_root: &Path) -> bool {
    repo_root.join(".git/MERGE_HEAD").exists()
}

Try / catch

match sync::run(&repo_root, &cmd) {
    Err(e) if e.to_string().contains("merge is still open") => {
        if let Some(packet) = extract_packet_path(&e.to_string()) {
            eprintln!("Resume with: :sync repair --packet {}", packet);
        } else {
            eprintln!("Finish the merge manually: git status && git add -A && git commit");
        }
    }
    other => other,
}

Prevention

When it happens

Trigger: The repair route ends with 'raw conflicts auto-resolved but merge not finalized'; `repair_packet_path` is Some, so the packet-aware variant of the bail fires, naming the packet via `packet_path.display()`.

Common situations: Agent removed conflict markers but could not stage/commit the merge (e.g., validation failures or unresolvable semantic conflicts); repair run aborted between marker cleanup and finalization.

Related errors


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