paperclipai/paperclip · error
Pass exactly one of --approve, --reject, or --request-change
Error message
Pass exactly one of --approve, --reject, or --request-changes.
What it means
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.
Source
Thrown at cli/src/commands/pipelines.ts:741
}
function looksLikeUuid(value: string): boolean {
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);
}
function exactlyOneFlag(first: boolean | undefined, second: boolean | undefined, firstName: string, secondName: string): string {
if (Boolean(first) === Boolean(second)) throw new Error(`Pass exactly one of ${firstName} or ${secondName}.`);
return first ? firstName : secondName;
}
function reviewDecisionFromOptions(opts: ReviewOptions): "approve" | "reject" | "request_changes" {
const selected = [
opts.approve ? { flag: "--approve", decision: "approve" as const } : null,
opts.reject ? { flag: "--reject", decision: "reject" as const } : null,
opts.requestChanges ? { flag: "--request-changes", decision: "request_changes" as const } : null,
].filter((item): item is NonNullable<typeof item> => item !== null);
if (selected.length !== 1) {
throw new Error("Pass exactly one of --approve, --reject, or --request-changes.");
}
return selected[0]!.decision;
}
function printPipeline(row: PipelineDetail | PipelineSummary | null, ctx: ResolvedClientContext): void {
if (!row) return printOutput(null, { json: ctx.json });
if (ctx.json) return printOutput(row, { json: true });
console.log(formatPipeline(row));
if ("stages" in row && row.stages?.length) {
console.log(pc.bold("Stages"));
row.stages.forEach((stage) => {
console.log(` ${formatInlineRecord({
id: stage.id,
key: stage.key,
name: stage.name,
kind: stage.kind,
position: stage.position,
})}`);View on GitHub (pinned to 67001ec6eb)
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.
Example fix
// before paperclipai pipelines review <id> --approve --reject // after paperclipai pipelines review <id> --approve
Defensive patterns
Strategy: validation
Validate before calling
function pickReview(opts: {approve?: boolean; reject?: boolean; requestChanges?: boolean}) {
const sel = [
opts.approve ? 'approve' : null,
opts.reject ? 'reject' : null,
opts.requestChanges ? 'request_changes' : null,
].filter((x): x is string => x !== null);
if (sel.length !== 1) throw new Error('Pass exactly one of --approve, --reject, or --request-changes.');
return sel[0];
} Prevention
- Drive the three flags from a single resolved decision string in automation.
- Provide a `--decision <value>` convenience option to avoid multi-flag mistakes.
When it happens
Trigger: 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.
Common situations: Operators toggling multiple review actions in one call, or scripts that always pass `--approve` and accidentally also pass `--request-changes` from a template.
Related errors
- Pass exactly one of ${firstName} or ${secondName}.
- Invalid ${label}: ${value}
- --payload must be a JSON object
- ${name} must be a JSON object
- Invalid ${name} JSON: ${err instanceof Error ? err.message :
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/d9402624fc831ee4.
Report an issue: GitHub.