{"record":{"id":"9e1eccadca716d97","repo":"paperclipai/paperclip","slug":"inherited-workspace-reuse-failed","errorCode":"inherited_workspace_reuse_failed","errorMessage":"Issue ${issueLabel} requested inherited execution workspace reuse for ${workspaceLabel}, but the workspace could not be restored because ${causeMessage}. ${remediation}","messagePattern":"Issue (.+?) requested inherited execution workspace reuse for (.+?), but the workspace could not be restored because (.+?)\\. (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/heartbeat.ts","lineNumber":5152,"sourceCode":"  for (const [key, value] of [\n    [\"summary\", input.summary],\n    [\"result\", input.result],\n    [\"message\", input.message],\n    [\"error\", input.error],\n  ] as const) {\n    const normalized = readNonEmptyString(value);\n    if (normalized) summary[key] = normalized;\n  }\n\n  for (const [key, value] of [\n    [\"total_cost_usd\", input.totalCostUsd],\n    [\"cost_usd\", input.costUsd],\n    [\"costUsd\", input.costUsdCamel],\n  ] as const) {\n    const normalized = readNonEmptyString(value);\n    if (!normalized) continue;\n    const parsed = Number(normalized);\n    if (Number.isFinite(parsed)) summary[key] = parsed;\n  }\n\n  return Object.keys(summary).length > 0 ? summary : null;\n}\n\nfunction normalizeLedgerBillingType(value: unknown): BillingType {\n  const raw = readNonEmptyString(value);\n  switch (raw) {\n    case \"api\":\n    case \"metered_api\":\n      return \"metered_api\";\n    case \"subscription\":\n    case \"subscription_included\":\n      return \"subscription_included\";\n    case \"subscription_overage\":\n      return \"subscription_overage\";\n    case \"credits\":\n      return \"credits\";","sourceCodeStart":5134,"sourceCodeEnd":5170,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/heartbeat.ts#L5134-L5170","documentation":"Error \"Issue ${issueLabel} requested inherited execution workspace reuse for ${workspaceLabel}, but the workspace could not be restored because ${causeMessage}. ${remediation}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/services/heartbeat.ts:4506 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the cause of the workspace restore failure named in the message, or follow the remediation provided."],"exampleFix":null,"handlingStrategy":"retry","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"}