Hmbown/CodeWhale · error · anyhow::Error
--receipt-path requires --write-receipt or --check-receipt
Error message
--receipt-path requires --write-receipt or --check-receipt
What it means
CLI argument validation in validate_review_receipt_args: `--receipt-path` only has meaning together with one of the receipt operations, `--write-receipt` (create a receipt) or `--check-receipt` (validate one). Passing a path with neither operation is rejected at startup.
Solutions
- Add --write-receipt to write the receipt at the given path
- Add --check-receipt to validate an existing receipt at the given path
- Drop --receipt-path if you do not intend to use receipts
Example fix
// before codewhale review --pr 123 --receipt-path receipt.json // after codewhale review --pr 123 --receipt-path receipt.json --write-receipt
Defensive patterns
Strategy: validation
Validate before calling
// validate flags before invoking
const ok = (args.receipt_path == null) || args.write_receipt || args.check_receipt;
if (!ok) throw new Error("--receipt-path requires --write-receipt or --check-receipt"); Prevention
- Always pair --receipt-path with --write-receipt or --check-receipt
- Build review commands from a wrapper script that enforces flag combos
- Check `codewhale review --help` for receipt flag requirements
When it happens
Trigger: Running `codewhale review ... --receipt-path <file>` without also passing --write-receipt or --check-receipt.
Common situations: Copy-pasting a receipt command and dropping the action flag; assuming --receipt-path alone implies writing a receipt; scripting the review command with a stale flag set.
Understand the failure class
Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.
Related errors
- Choose one input source, an unused --output path (or…
- --days must be an integer from 1 through 90
- duration resolved to zero seconds
- invalid value ' ' for '--provider ': expected one of …
- --max-passes applies only to --pr reviews
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/8c8106f5346628fb.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/lib.rs:9076
should_force_configured_exec_route(false, explicit_provider, explicit_model);
Ok((resolved, force_configured_route))
}
fn non_empty_flag(value: Option<&str>) -> Option<&str> {
value.map(str::trim).filter(|value| !value.is_empty())
}
fn resolve_review_model(config: &Config, explicit_model: Option<&str>) -> String {
explicit_model
.map(str::trim)
.filter(|model| !model.is_empty())
.map(str::to_string)
.unwrap_or_else(|| config.default_model())
}
fn validate_review_receipt_args(args: &ReviewArgs) -> Result<()> {
if args.receipt_path.is_some() && !args.write_receipt && !args.check_receipt {
bail!("--receipt-path requires --write-receipt or --check-receipt");
}
if args.write_receipt && args.check_receipt {
bail!("--write-receipt and --check-receipt are mutually exclusive");
}
if args.pr.is_none() && args.max_passes != 1 {
bail!("--max-passes applies only to --pr reviews");
}
if !(1..=crate::tools::review::MAX_REVIEW_PASSES).contains(&args.max_passes) {
bail!(
"--max-passes must be from 1 to {}",
crate::tools::review::MAX_REVIEW_PASSES
);
}
Ok(())
}
fn run_review_receipt_check(
diff: &str,View on GitHub (pinned to 73e0f67d83)