{"record":{"id":"0dd337477db4ecf0","repo":"paperclipai/paperclip","slug":"multiple-shared-companies-found-re-run-with-com","errorCode":null,"errorMessage":"Multiple shared companies found. Re-run with --company <id-or-prefix>. Options: ${options}","messagePattern":"Multiple shared companies found\\. Re-run with --company <id-or-prefix>\\. Options: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":3161,"sourceCode":"    );\n    if (!matched) {\n      throw new Error(`Could not resolve company \"${selector}\" in both source and target databases.`);\n    }\n    return matched;\n  }\n\n  if (shared.length === 1) {\n    return shared[0];\n  }\n\n  if (shared.length === 0) {\n    throw new Error(\"Source and target databases do not share a company id. Pass --company explicitly once both sides match.\");\n  }\n\n  const options = shared\n    .map((company) => `${company.issuePrefix} (${company.name})`)\n    .join(\", \");\n  throw new Error(`Multiple shared companies found. Re-run with --company <id-or-prefix>. Options: ${options}`);\n}\n\nfunction renderMergePlan(plan: Awaited<ReturnType<typeof collectMergePlan>>[\"plan\"], extras: {\n  sourcePath: string;\n  targetPath: string;\n  unsupportedRunCount: number;\n}): string {\n  const terminalWidth = Math.max(60, process.stdout.columns ?? 100);\n  const oneLine = (value: string) => value.replace(/\\s+/g, \" \").trim();\n  const truncateToWidth = (value: string, maxWidth: number) => {\n    if (maxWidth <= 1) return \"\";\n    if (value.length <= maxWidth) return value;\n    return `${value.slice(0, Math.max(0, maxWidth - 1)).trimEnd()}…`;\n  };\n  const lines = [\n    `Mode: preview`,\n    `Source: ${extras.sourcePath}`,\n    `Target: ${extras.targetPath}`,","sourceCodeStart":3143,"sourceCodeEnd":3179,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L3143-L3179","documentation":"Cross-database company resolution ambiguity: more than one company id is shared between source and target databases and no --company selector was passed, so the merge refuses to pick one arbitrarily and lists the options.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:2346 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run with --company <id-or-prefix> selecting one of the listed options."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}