{"record":{"id":"6b63f1d2e924b961","repo":"paperclipai/paperclip","slug":"failed-to-merge-concurrent-remote-git-histories-fo","errorCode":null,"errorMessage":"Failed to merge concurrent remote git histories for ${currentHead.slice(0, 12)} and ${input.importedHead.slice(0, 12)}: ${reason}","messagePattern":"Failed to merge concurrent remote git histories for (.+?) and (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/git-workspace-sync.ts","lineNumber":623,"sourceCode":"      timeout: 10_000,\n      maxBuffer: 16 * 1024,\n    }).catch(() => undefined);\n    await fs.rm(cloneDir, { recursive: true, force: true }).catch(() => undefined);\n  }\n}\n\nexport function createImportedGitRef(scope = \"remote\"): string {\n  return `refs/paperclip/git-sync/imported/${scope}/${randomUUID()}`;\n}\n\nexport function createRemoteGitExportRef(scope = \"remote\"): string {\n  return `refs/paperclip/git-sync/export/${scope}/${randomUUID()}`;\n}\n\nexport async function deleteLocalGitRef(input: {\n  localDir: string;\n  ref: string;\n}): Promise<void> {\n  await runLocalGit(input.localDir, [\"update-ref\", \"-d\", input.ref], {\n    timeout: 10_000,\n    maxBuffer: 16 * 1024,\n  }).catch(() => undefined);\n}\n\nexport async function fetchGitBundleIntoLocalRef(input: {\n  localDir: string;\n  bundlePath: string;\n  exportRef: string;\n  importedRef: string;\n  baseSha: string;\n}): Promise<string> {\n  const bundleSize = (await fs.stat(input.bundlePath).catch(() => null))?.size ?? 0;\n  if (bundleSize === 0) {\n    return input.baseSha;\n  }\n","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/adapter-utils/src/git-workspace-sync.ts#L605-L641","documentation":"deleteLocalGitRef's merge-tree step failed while reconciling the current HEAD with the concurrently imported HEAD; the underlying git error is included as the reason. Typically concurrent pushes or corrupted refs.","triggerScenarios":"Thrown at packages/adapter-utils/src/git-workspace-sync.ts:559 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the sync; merging concurrent histories can fail transiently.","Resolve the git conflict manually on the remote and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}