nikivdev/code · error

Sync agent cleared raw conflicts for {} but validation and m

Error message

Sync agent cleared raw conflicts for {} but validation and merge finalization are still pending.
Run `:sync repair --packet {}` or validate and finish the merge manually.

What it means

This error is raised by the sync agent's conflict-repair routing in src/sync.rs when the automated sync agent successfully cleared raw merge conflicts, but the subsequent merge validation and finalization steps never completed. The library refuses to silently leave the repository half-merged, so it bails with an actionable message pointing at the repair packet. It exists to force the user to either run the repair packet command or finish the merge manually.

Source

Thrown at src/sync.rs:4149

            SyncRepairKind::MergeConflict,
            &conflicted_files,
            &merge_detail,
            Some(&remote_ref),
            None,
            None,
        )
        .ok()
    };
    if should_fix && let Some(packet_path) = repair_packet_path.as_ref() {
        match try_route_sync_conflicts_to_sync_agent(repo_root, packet_path)? {
            SyncRepairRouteOutcome::Completed => {
                sync_progressln!("Sync agent resolved the sync repair flow");
                recorder.record(stage, "sync agent resolved merge conflicts");
                return Ok(());
            }
            SyncRepairRouteOutcome::ValidationPending => {
                recorder.record(stage, "merge validation pending after sync agent repair");
                bail!(
                    "Sync agent 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, "merge conflicts unresolved");
    if let Some(packet_path) = repair_packet_path {
        bail!(
            "Merge conflicts with {}.\nRun `:sync repair --packet {}` or resolve manually:\n  git status\n  # fix conflicts\n  git add . && git commit",
            remote_ref,
            packet_path.display()
        );
    }
    bail!(

View on GitHub (pinned to a747e741ae)

Solutions

  1. Run `:sync repair --packet <packet_path>` shown in the message to resume and finish the repair flow
  2. Manually validate the merge state (git status, resolve anything remaining) and complete the merge with a commit
  3. Inspect the repair packet file referenced in the message to see which validation step is pending
  4. Re-run the sync command once the merge is fully committed

Example fix

// before: repository in half-merged state after agent cleared markers
$ git status
Unmerged paths: src/foo.rs
// after: finish via the suggested packet command, then commit
$ :sync repair --packet /tmp/repair-packet.json
$ git add . && git commit
Defensive patterns

Strategy: validation

Validate before calling

// before running sync-agent repair, confirm merge is fully finalizable
let status = std::process::Command::new("git").args(["status", "--porcelain"]).output()?;
let unmerged = String::from_utf8_lossy(&status.stdout).lines().any(|l| l.starts_with("UU"));
if !unmerged && !merge_validated() {
    eprintln!("Run `:sync repair --packet <packet>` to finish pending validation");
}

Try / catch

// catch and surface the packet path for retry
match sync_result {
    Err(e) if e.to_string().contains("validation and merge finalization are still pending") => {
        eprintln!("Repair incomplete: {e}; run the suggested :sync repair --packet command");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running a sync operation where the sync-agent route returns SyncRepairRouteOutcome::ValidationPending — i.e. the agent removed conflict markers but merge validation and merge finalization are still pending for the given remote ref and repair packet.

Common situations: Automated sync repair stopped midway because validation (e.g. tests/build checks or merge-state checks) failed or was skipped; a sync agent run was interrupted; the packet was written but final `git commit`/validation never executed.

Related errors


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