paperclipai/paperclip · error · Error

Failed to integrate concurrent remote git history for

Error message

Failed to integrate concurrent remote git history for ${input.importedHead.slice(0, 12)} after multiple retries.

What it means

The git update-ref to integrate the imported history kept hitting concurrent-ref-update errors and the retry budget (several attempts) was exhausted; the remote history could not be integrated.

Solutions

  1. Retry later; concurrent history integration exhausted retries.
  2. Serialize workspace restores so only one runs at a time.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/adapter-utils/src/git-workspace-sync.ts:598 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-08-18). Data as JSON: /api/errors/1b49d5e841d0561c. Report an issue: GitHub.

Appendix: source

Thrown at packages/adapter-utils/src/git-workspace-sync.ts:662

    maxBuffer: 1024 * 1024,
  });
  const importedHead = await runLocalGit(input.localDir, ["rev-parse", input.importedRef], {
    timeout: 10_000,
    maxBuffer: 16 * 1024,
  });
  return importedHead.stdout.trim();
}

/** Substrings git emits when a bundle names a prerequisite the importer lacks. */
const GIT_MISSING_PREREQUISITE_MARKERS = [
  "did not send all necessary objects",
  "lacks these prerequisite commits",
  "revision walk setup failed",
];

/**
 * True when a bundle import failed because the host repository does not hold a
 * commit the (delta) bundle assumes as a prerequisite. Such a failure is
 * recoverable by re-exporting a full, self-contained bundle from the still-live
 * sandbox rather than discarding the run.
 */
export function isMissingGitPrerequisiteError(error: unknown): boolean {
  const message = error instanceof Error ? error.message : String(error);
  return GIT_MISSING_PREREQUISITE_MARKERS.some((marker) => message.includes(marker));
}

export function buildRemoteGitDeltaBundleScript(input: {
  remoteDir: string;
  baseSha: string;
  exportRef: string;
  bundlePath: string;
  statusPath?: string;
  catBundle?: boolean;
  cleanupBundle?: boolean;
  /**
   * Skip the delta boundary entirely and always emit a full, self-contained

View on GitHub (pinned to 3f1d897a7c)