{"record":{"id":"7f8a69613c1957ca","repo":"paperclipai/paperclip","slug":"failed-to-move-managed-checkout-into-place-at-c","errorCode":null,"errorMessage":"Failed to move managed checkout into place at \"${cwd}\": ${reason}","messagePattern":"Failed to move managed checkout into place at \"(.+?)\": (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/heartbeat.ts","lineNumber":1683,"sourceCode":"        eq(companySkillsTable.companyId, input.companyId),\n        inArray(companySkillsTable.id, mentionedSkillIds),\n      ),\n    );\n  const skillKeyById = new Map(skillRows.map((row) => [row.id, row.key]));\n  return mentionedSkillIds\n    .map((skillId) => skillKeyById.get(skillId) ?? null)\n    .filter((skillKey): skillKey is string => Boolean(skillKey));\n}\n\nexport function leaseReleaseStatusForRunStatus(\n  status: string | null | undefined,\n): Extract<EnvironmentLeaseStatus, \"released\" | \"expired\" | \"failed\"> {\n  if (status === \"cancelled\") return \"expired\";\n  return status === \"failed\" || status === \"timed_out\" ? \"failed\" : \"released\";\n}\n\nexport interface NativeSandboxLifecycle {\n  runnerProcess: \"per_turn\" | \"warm\";\n  sandboxResource: \"keep_running\" | \"stop_and_reuse\" | \"destroy_after_turn\";\n  failoverBackup: \"verified\";\n}\n\nexport function resolveNativeSandboxLifecycle(input: {\n  adapterType: string;\n  lifecyclePolicy:\n    | { mode: \"per_turn\"; idleTimeoutMs: null }\n    | { mode: \"warm\"; idleTimeoutMs: number };\n  target: {\n    kind: \"local\" | \"remote\";\n    transport?: string;\n    reusableLeaseConfigured?: boolean;\n    effectiveCapabilities?: { reusableLeases: boolean } | null;\n  } | null;\n}): NativeSandboxLifecycle | null {\n  if (\n    input.adapterType !== \"paperclip_runner\" ||","sourceCodeStart":1665,"sourceCodeEnd":1701,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/services/heartbeat.ts#L1665-L1701","documentation":"Materialization race/failure in heartbeat workspace materialization: the staged clone succeeded but fs.rename from the temp dir into the final cwd failed for the stated reason. The temp clone is cleaned up; if the target appeared concurrently the caller may adopt that checkout, otherwise the managed checkout cannot be placed and the error propagates.","triggerScenarios":"Thrown at server/src/services/heartbeat.ts:1679 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the reported failure moving the checkout into place (permissions, existing files), then retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}