paperclipai/paperclip · info · Error

Project mapping cancelled.

Error message

Project mapping cancelled.

What it means

Thrown by promptForProjectMappings when the user cancels the @clack/prompts select prompt for a missing source project mapping. During merge planning, source issues may reference projects absent in the target; the CLI prompts per-project to Import, Map, or Leave unset. Pressing escape/Ctrl-C (p.isCancel) aborts the entire merge flow with this message. It is a user-initiated cancellation, not a system fault.

Source

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

        },
        ...(nameMatch
          ? [{
              value: nameMatch.id,
              label: `Map to ${nameMatch.name}`,
              hint: "Recommended: exact name match",
            }]
          : []),
        {
          value: null,
          label: "Leave unset",
          hint: "Keep imported issues without a project",
        },
        ...targetChoices.filter((choice) => choice.value !== nameMatch?.id),
      ],
      initialValue: nameMatch?.id ?? null,
    });
    if (p.isCancel(selection)) {
      throw new Error("Project mapping cancelled.");
    }
    if (selection === importSelectionValue) {
      importProjectIds.add(sourceProjectId);
      continue;
    }
    mappings[sourceProjectId] = selection;
  }

  return {
    importProjectIds: [...importProjectIds],
    projectIdOverrides: mappings,
  };
}

export async function worktreeListCommand(opts: WorktreeListOptions): Promise<void> {
  const choices = toMergeSourceChoices(process.cwd());
  if (opts.json) {
    console.log(JSON.stringify(choices, null, 2));

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Re-run merge-history and complete the prompts, choosing Import / Map / Leave unset for each missing project.
  2. If you want to avoid prompts, pre-create the projects in the target or pass flags that pre-supply mappings if available.
  3. Run in an interactive TTY so the prompt is answerable.

Example fix

// before: user cancels the project-mapping select prompt
// after (complete the prompt)
paperclipai worktree:merge-history   # choose Import/Map/Leave for each project
Defensive patterns

Strategy: try-catch

Try / catch

try { await promptForProjectMappings(input); }
catch (err) {
  if (/Project mapping cancelled/.test(String((err as Error).message))) {
    // treat as non-fatal: abort merge gracefully, no rollback needed
    return;
  } else throw err;
}

Prevention

When it happens

Trigger: User hits Esc or Ctrl-C at the 'Project X is missing in target' select prompt; non-interactive shell where @clack detects cancel; user intentionally bails out of mapping.

Common situations: Decided not to proceed mid-flow; realised the target needs setup first; accidentally cancelled.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/2060b8ca5860d224. Report an issue: GitHub.