paperclipai/paperclip · error · Error

Invalid worktree seed-pending marker at

Error message

Invalid worktree seed-pending marker at ${filePath}.

What it means

The legacy seed-pending marker file failed JSON parsing or shape validation (not an object with version 1, state 'pending', and a sourceConfigPath string); the marker is corrupt and cannot be interpreted as a pending seed.

Solutions

  1. Inspect the seed-pending marker at ${filePath} and correct its contents.
  2. Remove the marker file and retry the seed operation.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cli/src/commands/worktree.ts:1452 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at cli/src/commands/worktree.ts:2005

function readLegacyWorktreeSeedPendingMarker(filePath: string): LegacyWorktreeSeedPendingMarker {
  let parsed: unknown;
  try {
    parsed = JSON.parse(readFileSync(filePath, "utf8"));
  } catch (error) {
    throw new Error(
      `Invalid worktree seed-pending marker at ${filePath}: ${error instanceof Error ? error.message : String(error)}`,
    );
  }

  if (
    !parsed
    || typeof parsed !== "object"
    || (parsed as { version?: unknown }).version !== 1
    || (parsed as { state?: unknown }).state !== "pending"
    || typeof (parsed as { sourceConfigPath?: unknown }).sourceConfigPath !== "string"
    || !(parsed as { sourceConfigPath: string }).sourceConfigPath.trim()
  ) {
    throw new Error(`Invalid worktree seed-pending marker at ${filePath}.`);
  }

  return parsed as LegacyWorktreeSeedPendingMarker;
}

const WORKTREE_SEED_LOCK_POLL_MS = 50;
const WORKTREE_SEED_LOCK_MALFORMED_STALE_MS = 60_000;

type WorktreeSeedLockOwner = {
  version: 1;
  pid: number;
  token: string;
  createdAt: string;
};

function processIsAlive(pid: number): boolean {
  try {
    process.kill(pid, 0);

View on GitHub (pinned to 01ad858492)