paperclipai/paperclip · error

Invalid worktree seed-pending marker at

Error message

Invalid worktree seed-pending marker at ${filePath}: ${error instanceof Error ? error.message : String(error)}

What it means

Corruption guard when reading a worktree seed-pending marker: the marker file exists but failed to parse (invalid JSON or unexpected shape), so the seed state machine cannot resume and surfaces the underlying parse error.

Solutions

  1. Fix the JSON syntax in the seed-pending marker file at ${filePath}.
  2. Delete the marker file at ${filePath} and re-run the seed so a valid marker is written.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/worktree.ts:1439 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/c3706310070b00a4. Report an issue: GitHub.

Appendix: source

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

    phase: input.phase,
    state: nextState,
    snapshotAt: input.snapshotAt === undefined ? current.snapshotAt : input.snapshotAt,
    migrationRevision:
      input.migrationRevision === undefined ? current.migrationRevision : input.migrationRevision,
    startedAt: current.startedAt ?? (input.status === "started" ? at : null),
    finishedAt: nextState === "verified" || nextState === "failed" ? at : null,
    diagnostics: [...current.diagnostics, diagnostic].slice(-WORKTREE_SEED_DIAGNOSTIC_LIMIT),
  };
  writeWorktreeSeedManifest(markers.manifest, next);
  return next;
}

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;
}

View on GitHub (pinned to 01ad858492)