{"record":{"id":"d9402624fc831ee4","repo":"paperclipai/paperclip","slug":"pass-exactly-one-of-approve-reject-or-requ","errorCode":null,"errorMessage":"Pass exactly one of --approve, --reject, or --request-changes.","messagePattern":"Pass exactly one of --approve, --reject, or --request-changes\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/pipelines.ts","lineNumber":741,"sourceCode":"}\n\nfunction looksLikeUuid(value: string): boolean {\n  return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);\n}\n\nfunction exactlyOneFlag(first: boolean | undefined, second: boolean | undefined, firstName: string, secondName: string): string {\n  if (Boolean(first) === Boolean(second)) throw new Error(`Pass exactly one of ${firstName} or ${secondName}.`);\n  return first ? firstName : secondName;\n}\n\nfunction reviewDecisionFromOptions(opts: ReviewOptions): \"approve\" | \"reject\" | \"request_changes\" {\n  const selected = [\n    opts.approve ? { flag: \"--approve\", decision: \"approve\" as const } : null,\n    opts.reject ? { flag: \"--reject\", decision: \"reject\" as const } : null,\n    opts.requestChanges ? { flag: \"--request-changes\", decision: \"request_changes\" as const } : null,\n  ].filter((item): item is NonNullable<typeof item> => item !== null);\n  if (selected.length !== 1) {\n    throw new Error(\"Pass exactly one of --approve, --reject, or --request-changes.\");\n  }\n  return selected[0]!.decision;\n}\n\nfunction printPipeline(row: PipelineDetail | PipelineSummary | null, ctx: ResolvedClientContext): void {\n  if (!row) return printOutput(null, { json: ctx.json });\n  if (ctx.json) return printOutput(row, { json: true });\n  console.log(formatPipeline(row));\n  if (\"stages\" in row && row.stages?.length) {\n    console.log(pc.bold(\"Stages\"));\n    row.stages.forEach((stage) => {\n      console.log(`  ${formatInlineRecord({\n        id: stage.id,\n        key: stage.key,\n        name: stage.name,\n        kind: stage.kind,\n        position: stage.position,\n      })}`);","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/pipelines.ts#L723-L759","documentation":"Thrown by reviewDecisionFromOptions() when the count of selected review-decision flags is not exactly one. It collects --approve, --reject, --request-changes into an array and requires a single selection so the API receives an unambiguous review decision.","triggerScenarios":"Running a pipelines review subcommand (line 597) with zero of the three flags, or with two or three of them. Passing `--approve --reject`, `--reject --request-changes`, or all three triggers it; passing none does too.","commonSituations":"Operators toggling multiple review actions in one call, or scripts that always pass `--approve` and accidentally also pass `--request-changes` from a template.","solutions":["Choose exactly one review action flag and remove the others.","If unsure of the decision, run the command with `--help` to see the three valid options.","In automation, drive the flag from a single resolved decision string rather than independent booleans."],"exampleFix":"// before\npaperclipai pipelines review <id> --approve --reject\n// after\npaperclipai pipelines review <id> --approve","handlingStrategy":"validation","validationCode":"function pickReview(opts: {approve?: boolean; reject?: boolean; requestChanges?: boolean}) {\n  const sel = [\n    opts.approve ? 'approve' : null,\n    opts.reject ? 'reject' : null,\n    opts.requestChanges ? 'request_changes' : null,\n  ].filter((x): x is string => x !== null);\n  if (sel.length !== 1) throw new Error('Pass exactly one of --approve, --reject, or --request-changes.');\n  return sel[0];\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Drive the three flags from a single resolved decision string in automation.","Provide a `--decision <value>` convenience option to avoid multi-flag mistakes."],"tags":["cli","validation","flags","review","pipelines"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}