paperclipai/paperclip · error · WorkspaceValidationFailure

Execution workspace ${branchInspection.workspaceRecord.id} e

Error message

Execution workspace ${branchInspection.workspaceRecord.id} expected git worktree branch "${inspection.expectedBranchName}" at "${inspection.worktreePath}", but ${inspection.reason ?? "the checked-out branch could not be verified"}. Record a sanctioned execution-workspace branch transition or restore the workspace branch before completing the run.

What it means

Error "Execution workspace ${branchInspection.workspaceRecord.id} expected git worktree branch "${inspection.expectedBranchName}" at "${inspection.worktreePath}", but ${inspection.reason ?? "the checked-out branch could not be verified"}. Record a sanctioned execution-workspace branch transition or restore the workspace branch before completing the run." thrown in paperclipai/paperclip.

Source

Thrown at server/src/services/heartbeat.ts:15759

    }
    return null;
  }

  function latestDate(...values: unknown[]) {
    let latest: Date | null = null;
    for (const value of values) {
      const parsed = dateValue(value);
      if (!parsed) continue;
      if (!latest || parsed.getTime() > latest.getTime()) latest = parsed;
    }
    return latest;
  }

  async function buildRunLivenessInput(
    run: typeof heartbeatRuns.$inferSelect,
    resultJson: Record<string, unknown> | null | undefined,
  ): Promise<RunLivenessClassificationInput> {
    const context = parseObject(run.contextSnapshot);
    const contextIssueId = readNonEmptyString(context.issueId);
    const continuationAttempt = asNumber(
      context.continuationAttempt,
      run.continuationAttempt ?? 0,
    );

    const issue = contextIssueId
      ? await db
          .select({
            status: issues.status,
            title: issues.title,
            description: issues.description,
          })
          .from(issues)
          .where(
            and(
              eq(issues.companyId, run.companyId),
              eq(issues.id, contextIssueId),

View on GitHub (pinned to 01ad858492)

Solutions

  1. Restore the expected branch in the execution workspace, or record a sanctioned execution-workspace branch transition, then complete the run.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/heartbeat.ts:15922 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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