{"record":{"id":"957b345ff901585f","repo":"paperclipai/paperclip","slug":"failed-to-integrate-concurrent-ssh-git-history-for","errorCode":null,"errorMessage":"Failed to integrate concurrent SSH git history for ${input.importedHead.slice(0, 12)} after multiple retries.","messagePattern":"Failed to integrate concurrent SSH git history for (.+?) after multiple retries\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/ssh.ts","lineNumber":1038,"sourceCode":"      ],\n      {\n        timeout: 60_000,\n        maxBuffer: 64 * 1024,\n      },\n    );\n    try {\n      await runLocalGit(input.localDir, [\"update-ref\", headRef, mergeCommit.stdout.trim(), currentHead], {\n        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  throw new Error(`Failed to integrate concurrent SSH git history for ${input.importedHead.slice(0, 12)} after multiple retries.`);\n}\n\nasync function clearRemoteDirectory(input: {\n  spec: SshConnectionConfig;\n  remoteDir: string;\n  preserveEntries?: string[];\n}): Promise<void> {\n  const preservePatterns = (input.preserveEntries ?? [])\n    .map((entry) => `! -name ${shellQuote(entry)}`)\n    .join(\" \");\n  const script = [\n    \"set -e\",\n    `mkdir -p ${shellQuote(input.remoteDir)}`,\n    `find ${shellQuote(input.remoteDir)} -mindepth 1 -maxdepth 1 ${preservePatterns} -exec rm -rf -- {} +`,\n  ].join(\"\\n\");\n  await runSshScript(input.spec, script, {\n    timeoutMs: 30_000,\n    maxBuffer: 256 * 1024,","sourceCodeStart":1020,"sourceCodeEnd":1056,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/adapter-utils/src/ssh.ts#L1020-L1056","documentation":"Error \"Failed to integrate concurrent SSH git history for ${input.importedHead.slice(0, 12)} after multiple retries.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/adapter-utils/src/ssh.ts:1038 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry later; integration exhausted retries.","Serialize concurrent SSH workspace restores."],"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"}