paperclipai/paperclip · error · Error

Worktree seed manifest does not exist at

Error message

Worktree seed manifest does not exist at ${markers.manifest}.

What it means

updateWorktreeSeedManifest() records each phase transition (started/succeeded/failed) into the existing manifest; it refuses to invent one. readWorktreeSeedManifest returned null, meaning no manifest file exists at the resolved marker path — either it was never created (markWorktreeSeedPending must run first) or it disappeared mid-seed (concurrent cleanup), or the wrong configPath resolved to different marker paths.

Solutions

  1. Run the full ensureWorktreeSeeded flow (it creates the pending manifest before updating) instead of calling update directly
  2. Make sure no cleanup/deletion runs against the worktree markers while a seed is in progress
  3. Verify the configPath passed to the seed matches the worktree's actual config location
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs';
import { resolveWorktreeSeedMarkerPaths, markWorktreeSeedPending } from './worktree-lib';

if (!existsSync(resolveWorktreeSeedMarkerPaths(configPath).manifest)) {
  markWorktreeSeedPending({ configPath, sourceConfigPath, targetInstanceId, seedMode: 'minimal' });
}
updateWorktreeSeedManifest({ configPath, phase, status });

Prevention

When it happens

Trigger: Calling updateWorktreeSeedManifest before markWorktreeSeedPending ever created the manifest; another process deleting the marker files while a seed runs; passing a configPath whose resolved marker directory differs from the one the manifest was written under.

Common situations: A cleanup command racing an in-flight seed on the same worktree; invoking seed helpers out of order in custom automation; moving/renaming the worktree config so marker paths change.

Related errors


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

Appendix: source

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

  // New manifests are authoritative. Legacy files are removed so no caller can
  // mistake a stale binary marker for current verified seed state.
  rmSync(markers.complete, { force: true });
  rmSync(markers.pending, { force: true });
}

function updateWorktreeSeedManifest(input: {
  configPath: string;
  phase: WorktreeSeedPhase;
  status: "started" | "succeeded" | "failed";
  state?: WorktreeSeedManifest["state"];
  message?: string;
  snapshotAt?: string | null;
  migrationRevision?: string | null;
  now?: Date;
}): WorktreeSeedManifest {
  const markers = resolveWorktreeSeedMarkerPaths(input.configPath);
  const current = readWorktreeSeedManifest(input.configPath);
  if (!current) throw new Error(`Worktree seed manifest does not exist at ${markers.manifest}.`);
  const at = (input.now ?? new Date()).toISOString();
  const nextState = input.state ?? current.state;
  const diagnostic = {
    phase: input.phase,
    status: input.status,
    at,
    ...(input.message
      ? { message: input.message.slice(0, WORKTREE_SEED_DIAGNOSTIC_MESSAGE_LIMIT) }
      : {}),
  };
  const next: WorktreeSeedManifest = {
    ...current,
    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),

View on GitHub (pinned to 01ad858492)