{"record":{"id":"e2a94f23292f3b1e","repo":"paperclipai/paperclip","slug":"failed-to-compute-a-merged-git-tree-for-workspace","errorCode":null,"errorMessage":"Failed to compute a merged git tree for workspace restore.","messagePattern":"Failed to compute a merged git tree for workspace restore\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/git-workspace-sync.ts","lineNumber":629,"sourceCode":"\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\n  await runLocalGit(input.localDir, [\"fetch\", \"--force\", input.bundlePath, `${input.exportRef}:${input.importedRef}`], {\n    timeout: 60_000,\n    maxBuffer: 1024 * 1024,\n  });\n  const importedHead = await runLocalGit(input.localDir, [\"rev-parse\", input.importedRef], {\n    timeout: 10_000,","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/adapter-utils/src/git-workspace-sync.ts#L611-L647","documentation":"merge-tree succeeded but its stdout had no usable first line to use as the merged tree id, so the workspace restore cannot proceed with the merged tree.","triggerScenarios":"Thrown at packages/adapter-utils/src/git-workspace-sync.ts:565 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the workspace restore; tree merge failed.","Reset the workspace and re-import from a clean state."],"exampleFix":null,"handlingStrategy":"type-guard","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"}