{"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":1894,"sourceCode":"    (input.environmentDriver ?? null) !== \"sandbox\"\n  ) {\n    const resolvedEnv = parseObject(resolvedConfig.env);\n    const readiness = await evaluateCodexCredentialReadiness({\n      env: process.env,\n      companyId: input.companyId,\n      configuredCodexHome: readNonEmptyString(resolvedEnv.CODEX_HOME),\n      configuredApiKey: readNonEmptyString(resolvedEnv.OPENAI_API_KEY),\n    });\n    if (readiness.managed && !readiness.ready) {\n      throw new ConfigurationIncompleteFailure(\n        `configuration incomplete: no Codex credentials available for managed home \"${readiness.effectiveHome}\". ` +\n          `Sign in to Codex on the host with a ChatGPT subscription, or bind a per-agent OPENAI_API_KEY secret for this agent.`,\n        {\n          configurationIncomplete: {\n            reason: \"codex_credentials_missing\",\n            companyId: input.companyId,\n            agentId: input.agentId ?? null,\n            issueId: input.issueId ?? null,\n            projectId: input.projectId ?? null,\n            routineId: input.routineId ?? null,\n            responsibleUserId: input.responsibleUserId ?? null,\n            adapterType: \"codex_local\",\n            requiredEnvKeys: [\"OPENAI_API_KEY\"],\n            effectiveCodexHome: readiness.effectiveHome,\n            missingBindings: [],\n          },\n        },\n      );\n    }\n  }\n  return {\n    resolvedConfig,\n    secretKeys,\n    secretManifest: [\n      ...(environmentEnvResolution.manifest ?? []),\n      ...(manifest ?? []),","sourceCodeStart":1876,"sourceCodeEnd":1912,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/heartbeat.ts#L1876-L1912","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":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}