{"record":{"id":"b28c635b9c4ec707","repo":"paperclipai/paperclip","slug":"configured-warning","errorCode":null,"errorMessage":"${configured.warning}","messagePattern":"\\$\\{configured\\.warning\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-instance-cleanup.ts","lineNumber":255,"sourceCode":"    expandHomePrefix(\n      worktreesDir?.trim()\n      || process.env.PAPERCLIP_WORKTREES_DIR?.trim()\n      || path.join(os.homedir(), \".paperclip-worktrees\"),\n    ),\n  );\n  return path.join(managedWorktreesDir, \"instances\");\n}\n\nexport async function readManagedWorktreeInstanceOwnership(\n  workspacePath: string,\n  worktreesDir?: string,\n): Promise<{ instanceRoot: string; instanceId: string } | null> {\n  const pointer = await readWorktreeInstancePointer(workspacePath);\n  if (!pointer) return null;\n  const configured = resolveConfiguredInstanceRoot(pointer);\n  if (\"warning\" in configured) {\n    if (!configured.warning) return null;\n    throw new Error(configured.warning);\n  }\n  const managedInstancesDir = resolveManagedInstancesDir(worktreesDir);\n  if (!isStrictChildPath(configured.instanceRoot, managedInstancesDir)) {\n    throw new Error(\n      `Refusing to record worktree instance ownership for \"${configured.instanceRoot}\" because it is outside \"${managedInstancesDir}\".`,\n    );\n  }\n  return configured;\n}\n\nexport async function cleanupWorktreeInstanceArtifacts(input: {\n  pointer: WorktreeInstancePointer;\n  workspaceId: string;\n  workspacePath: string;\n  expectedInstanceId: string;\n  expectedInstanceRoot: string | null;\n  recorder?: WorkspaceOperationRecorder | null;\n  worktreesDir?: string;","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-instance-cleanup.ts#L237-L273","documentation":"readManagedWorktreeInstanceOwnership resolved the worktree instance pointer but the configured instance root produced a warning (e.g. unresolvable or malformed pointer target) that is severe enough to throw rather than ignore. The pointer file's configured root is unusable for ownership resolution.","triggerScenarios":"Thrown at server/src/services/workspace-instance-cleanup.ts:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A configured cleanup warning was raised; read the warning text for the specific condition and resolve it before proceeding."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}