{"record":{"id":"c55fa5f4bd51da91","repo":"paperclipai/paperclip","slug":"failed-to-merge-concurrent-ssh-git-histories-for","errorCode":null,"errorMessage":"Failed to merge concurrent SSH git histories for ${currentHead.slice(0, 12)} and ${input.importedHead.slice(0, 12)}: ${reason}","messagePattern":"Failed to merge concurrent SSH git histories for (.+?) and (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/ssh.ts","lineNumber":999,"sourceCode":"          timeout: 10_000,\n          maxBuffer: 16 * 1024,\n        });\n        return;\n      } catch (error) {\n        if (isConcurrentRefUpdateError(error) && attempt < 4) continue;\n        throw error;\n      }\n    }\n\n    let mergedTree;\n    try {\n      mergedTree = await runLocalGit(input.localDir, [\"merge-tree\", \"--write-tree\", currentHead, input.importedHead], {\n        timeout: 60_000,\n        maxBuffer: 256 * 1024,\n      });\n    } catch (error) {\n      const reason = error instanceof Error ? error.message : String(error);\n      throw new Error(\n        `Failed to merge concurrent SSH git histories for ${currentHead.slice(0, 12)} and ${input.importedHead.slice(0, 12)}: ${reason}`,\n      );\n    }\n    const mergedTreeId = mergedTree.stdout.trim().split(\"\\n\")[0]?.trim() ?? \"\";\n    if (!mergedTreeId) {\n      throw new Error(\"Failed to compute a merged git tree for SSH workspace restore.\");\n    }\n\n    const mergeCommit = await runLocalGit(\n      input.localDir,\n      [\n        ...GIT_SYNC_COMMIT_IDENTITY_ARGS,\n        \"commit-tree\",\n        mergedTreeId,\n        \"-p\",\n        currentHead,\n        \"-p\",\n        input.importedHead,","sourceCodeStart":981,"sourceCodeEnd":1017,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/adapter-utils/src/ssh.ts#L981-L1017","documentation":"Error \"Failed to merge concurrent SSH git histories for ${currentHead.slice(0, 12)} and ${input.importedHead.slice(0, 12)}: ${reason}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/adapter-utils/src/ssh.ts:999 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the SSH sync; merging concurrent histories can fail transiently.","Resolve the git conflict on the remote manually and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}