{"record":{"id":"e8619d56555f147a","repo":"paperclipai/paperclip","slug":"workspace-validation-failed","errorCode":"workspace_validation_failed","errorMessage":"Persisted git worktree \"${reuseWorktreePath}\" is not reusable (${validation.reason}).","messagePattern":"Persisted git worktree \"(.+?)\" is not reusable \\((.+?)\\)\\.","errorType":"exception","errorClass":"WorkspaceRuntimeValidationFailure","httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":3441,"sourceCode":"        persistForwardReconcile: false,\n        reconcileOperationPhase: \"worktree_prepare\",\n        recorder: input.recorder ?? null,\n      });\n      if (coherence.branchName) {\n        realized.branchName = coherence.branchName;\n      }\n      if (coherence.reconciledForward) {\n        realized.pendingForwardBranchReconcile = coherence.pendingForwardBranchReconcile ?? null;\n      }\n      repairWarnings.push(...coherence.warnings);\n    }\n    const validation = await validateLinkedGitWorktree({\n      repoRoot,\n      worktreePath: reuseWorktreePath,\n      expectedBranchName: realized.branchName,\n    });\n    if (!validation.valid) {\n      throw new WorkspaceRuntimeValidationFailure(\n        `Persisted git worktree \"${reuseWorktreePath}\" is not reusable (${validation.reason}).`,\n        {\n          workspaceValidation: {\n            reason: \"git_worktree_not_reusable\",\n            reasonCode: validation.reasonCode,\n            worktreePath: reuseWorktreePath,\n            executionWorkspaceId: input.workspace.id ?? null,\n          },\n        },\n      );\n    }\n    const baseRefreshWarnings = reuseBaseRef\n      ? await refreshRemoteTrackingBaseRef(repoRoot, reuseBaseRef, input.resolveGitAuth)\n      : [];\n    const currentBaseRefSha = reuseBaseRef ? await resolveBaseRefSha(repoRoot, reuseBaseRef) : null;\n    const refresh = reuseBaseRef && currentBaseRefSha\n      ? await refreshUnstartedWorktreeToBase({\n          repoRoot,","sourceCodeStart":3423,"sourceCodeEnd":3459,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L3423-L3459","documentation":"Workspace restore tried to reuse the persisted git worktree path, but validateLinkedGitWorktree returned an invalid result (reason appended: wrong branch, detached metadata, corruption). The persisted worktree cannot be trusted for reuse and must be rebuilt.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:3382 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The persisted worktree failed validation for the stated reason. Remove/recreate the worktree ('git worktree remove', then rebuild) and retry."],"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-14T05:17:10.506Z"}