paperclipai/paperclip · error · WorkspaceRuntimeValidationFailure

workspace_validation_failed

workspace_validation_failed

Error message

Persisted git worktree "${reuseWorktreePath}" is not reusable (${validation.reason}).

What it means

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.

Source

Thrown at server/src/services/workspace-runtime.ts:3441

        persistForwardReconcile: false,
        reconcileOperationPhase: "worktree_prepare",
        recorder: input.recorder ?? null,
      });
      if (coherence.branchName) {
        realized.branchName = coherence.branchName;
      }
      if (coherence.reconciledForward) {
        realized.pendingForwardBranchReconcile = coherence.pendingForwardBranchReconcile ?? null;
      }
      repairWarnings.push(...coherence.warnings);
    }
    const validation = await validateLinkedGitWorktree({
      repoRoot,
      worktreePath: reuseWorktreePath,
      expectedBranchName: realized.branchName,
    });
    if (!validation.valid) {
      throw new WorkspaceRuntimeValidationFailure(
        `Persisted git worktree "${reuseWorktreePath}" is not reusable (${validation.reason}).`,
        {
          workspaceValidation: {
            reason: "git_worktree_not_reusable",
            reasonCode: validation.reasonCode,
            worktreePath: reuseWorktreePath,
            executionWorkspaceId: input.workspace.id ?? null,
          },
        },
      );
    }
    const baseRefreshWarnings = reuseBaseRef
      ? await refreshRemoteTrackingBaseRef(repoRoot, reuseBaseRef, input.resolveGitAuth)
      : [];
    const currentBaseRefSha = reuseBaseRef ? await resolveBaseRefSha(repoRoot, reuseBaseRef) : null;
    const refresh = reuseBaseRef && currentBaseRefSha
      ? await refreshUnstartedWorktreeToBase({
          repoRoot,

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. The persisted worktree failed validation for the stated reason. Remove/recreate the worktree ('git worktree remove', then rebuild) and retry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/workspace-runtime.ts:3382 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/e8619d56555f147a. Report an issue: GitHub.