paperclipai/paperclip · error · Error
Invalid worktree seed manifest at ${manifestPath}.
Error message
Invalid worktree seed manifest at ${manifestPath}. What it means
The second stage of readWorktreeSeedManifest(): the file parsed as JSON but failed shape validation — source.instanceId / source.configPath must be strings, targetInstanceId non-empty, seedMode and phase must be known values, state in pending/running/verified/failed, attemptId non-empty, every diagnostics entry must have a known phase, status in started/succeeded/failed, string timestamp, and the verified-terminal block must be valid. This guards the loader against a manifest from an incompatible schema.
Source
Thrown at cli/src/commands/worktree.ts:1943
);
if (
!value
|| typeof value !== "object"
|| value.version !== 2
|| !value.source
|| typeof value.source.instanceId !== "string"
|| typeof value.source.configPath !== "string"
|| typeof value.targetInstanceId !== "string"
|| value.targetInstanceId.length === 0
|| !isWorktreeSeedMode(String(value.seedMode ?? ""))
|| !WORKTREE_SEED_PHASES.includes(value.phase as WorktreeSeedPhase)
|| !["pending", "running", "verified", "failed"].includes(String(value.state ?? ""))
|| typeof value.attemptId !== "string"
|| value.attemptId.length === 0
|| !diagnosticsValid
|| !verifiedTerminalValid
) {
throw new Error(`Invalid worktree seed manifest at ${manifestPath}.`);
}
return value as WorktreeSeedManifest;
}
export function markWorktreeSeedPending(input: {
configPath: string;
sourceConfigPath: string;
targetInstanceId?: string;
seedMode?: WorktreeSeedMode;
now?: Date;
diagnosticMessage?: string;
}): void {
const markers = resolveWorktreeSeedMarkerPaths(input.configPath);
const at = (input.now ?? new Date()).toISOString();
writeWorktreeSeedManifest(markers.manifest, {
version: 2,
source: {
instanceId: resolveSeedInstanceId(input.sourceConfigPath),View on GitHub (pinned to a7e689b3c3)
Solutions
- Remove the invalid manifest (and its lock marker if stale) and re-run the seed so a fresh valid manifest is written
- Use the CLI version that matches the worktree/registration, or upgrade both together
- Do not hand-edit seed manifest files; use the seed commands to change state
Defensive patterns
Strategy: fallback
Validate before calling
try {
manifest = readWorktreeSeedManifest(configPath);
} catch {
// schema mismatch (e.g. CLI version change): discard and reseed
removeSeedMarkers(configPath);
return ensureWorktreeSeeded({ configPath, ...opts });
} Try / catch
Distinguish parse failure (error 9) from shape failure (this one) only for logging; both remediate the same way — remove markers and reseed.
Prevention
- Upgrade the CLI and worktree registrations together so manifest schemas stay in sync
- Use seed commands to change state; never edit marker JSON
When it happens
Trigger: Reading a manifest written by an older or newer CLI version with a different schema, a hand-edited manifest with a typo, or a partially written file that still parses as JSON but misses required fields.
Common situations: Downgrading/upgrading the CLI across a manifest schema change; editing markers to reset a stuck seed; merging worktree dirs with tools that mangled field values.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Invalid worktree seed manifest at ${manifestPath}: ${error i
- Worktree seed manifest does not exist at ${markers.manifest}
- Worktree seed manifest target instance does not match the re
- Worktree seed source diagnostics changed while waiting for t
- Failed to create a pending worktree seed manifest.
AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-21).
Data as JSON: /api/errors/fd8d7cd5e97669a6.
Report an issue: GitHub.