{"record":{"id":"aa0a95dae133e4e5","repo":"paperclipai/paperclip","slug":"selector-selector-is-ambiguous-matches-both","errorCode":null,"errorMessage":"Selector '${selector}' is ambiguous (matches both an ID and a shortname). Re-run with --by id or --by prefix.","messagePattern":"Selector '(.+?)' is ambiguous \\(matches both an ID and a shortname\\)\\. Re-run with --by id or --by prefix\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1300,"sourceCode":"  const idMatch = companies.find((company) => company.id === selector);\n  const prefixMatch = companies.find((company) => matchesPrefix(company, selector));\n\n  if (by === \"id\") {\n    if (!idMatch) {\n      throw new Error(`No company found by ID '${selector}'.`);\n    }\n    return idMatch;\n  }\n\n  if (by === \"prefix\") {\n    if (!prefixMatch) {\n      throw new Error(`No company found by shortname/prefix '${selector}'.`);\n    }\n    return prefixMatch;\n  }\n\n  if (idMatch && prefixMatch && idMatch.id !== prefixMatch.id) {\n    throw new Error(\n      `Selector '${selector}' is ambiguous (matches both an ID and a shortname). Re-run with --by id or --by prefix.`,\n    );\n  }\n\n  if (idMatch) return idMatch;\n  if (prefixMatch) return prefixMatch;\n\n  throw new Error(\n    `No company found for selector '${selector}'. Use company ID or issue prefix (for example PAP).`,\n  );\n}\n\nexport function assertDeleteConfirmation(company: Company, opts: CompanyDeleteOptions): void {\n  if (!opts.yes) {\n    throw new Error(\"Deletion requires --yes.\");\n  }\n\n  const confirm = opts.confirm?.trim();","sourceCodeStart":1282,"sourceCodeEnd":1318,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1282-L1318","documentation":"In auto mode the selector matched both a company ID and a different company's issue prefix, so the deletion target is ambiguous and the guard demands an explicit --by mode.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disambiguate with --by id or --by prefix."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}