paperclipai/paperclip · error · Error

Confirmation '${confirm}' does not match target company. Exp

Error message

Confirmation '${confirm}' does not match target company. Expected ID '${company.id}' or prefix '${company.issuePrefix}'.

What it means

Thrown by assertDeleteConfirmation when --confirm is provided but its value matches neither the target company's id (case-sensitive) nor its issue prefix (case-insensitive). The acknowledgement must prove intent against THIS company; a mismatch suggests the operator is targeting the wrong record.

Source

Thrown at cli/src/commands/client/company.ts:1328

  );
}

export function assertDeleteConfirmation(company: Company, opts: CompanyDeleteOptions): void {
  if (!opts.yes) {
    throw new Error("Deletion requires --yes.");
  }

  const confirm = opts.confirm?.trim();
  if (!confirm) {
    throw new Error(
      "Deletion requires --confirm <value> where value matches the company ID or issue prefix.",
    );
  }

  const confirmsById = confirm === company.id;
  const confirmsByPrefix = confirm.toUpperCase() === company.issuePrefix.toUpperCase();
  if (!confirmsById && !confirmsByPrefix) {
    throw new Error(
      `Confirmation '${confirm}' does not match target company. Expected ID '${company.id}' or prefix '${company.issuePrefix}'.`,
    );
  }
}

function assertDeleteFlags(opts: CompanyDeleteOptions): void {
  if (!opts.yes) {
    throw new Error("Deletion requires --yes.");
  }
  if (!opts.confirm?.trim()) {
    throw new Error(
      "Deletion requires --confirm <value> where value matches the company ID or issue prefix.",
    );
  }
}

export function registerCompanyCommands(program: Command): void {
  const company = program.command("company").description("Company operations");

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Ensure --confirm matches the resolved company's id or current issue prefix exactly.
  2. Re-run 'paperclipai company list' to read the canonical id and prefix.
  3. Align the selector and the --confirm value so they refer to the same company.
  4. If the prefix changed recently, use the new prefix (or the stable id) for --confirm.

Example fix

# before (selector and confirm disagree)
paperclipai company delete PAP --yes --confirm cmp_other
# after
paperclipai company delete PAP --yes --confirm PAP
Defensive patterns

Strategy: validation

Validate before calling

function ensureConfirmMatches(company: { id: string; issuePrefix: string }, confirm: string): void {
  const c = confirm.trim();
  const ok = c === company.id || c.toUpperCase() === company.issuePrefix.toUpperCase();
  if (!ok) {
    throw new Error(`--confirm must equal id '${company.id}' or prefix '${company.issuePrefix}'.`);
  }
}

Type guard

function confirmMatchesCompany(company: { id: string; issuePrefix: string }, confirm: string): boolean {
  const c = confirm.trim();
  return c === company.id || c.toUpperCase() === company.issuePrefix.toUpperCase();
}

Prevention

When it happens

Trigger: Passing --confirm with a different company's id/prefix. Typing the prefix in the wrong case is tolerated for prefix but id match is case-sensitive. Passing --confirm yes, true, the company name, or any non-matching token. Selecting one company by selector but confirming against another.

Common situations: Operator pastes the wrong company's prefix. Selector resolves to company A but --confirm holds company B's prefix from a previous command. The company was renamed/re-prefixed between selector resolution and confirmation.

Related errors


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