{"record":{"id":"696458ea21a8f308","repo":"gitbutlerapp/gitbutler","slug":"unable-to-determine-which-reviews-to-target","errorCode":null,"errorMessage":"Unable to determine which reviews to target","messagePattern":"Unable to determine which reviews to target","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but/src/command/legacy/forge/review.rs","lineNumber":1251,"sourceCode":"        .flat_map(|stack| {\n            stack.branches.iter().filter_map(|branch| {\n                let review_id = branch.review_id?;\n                Some((format!(\"{} ({})\", branch.name, review_id), review_id))\n            })\n        })\n        .collect::<Vec<_>>();\n    let branch_reviews =\n        nonempty::NonEmpty::from_vec(branch_reviews).context(\"No reviews available to select\")?;\n    let mut input = out\n        .prepare_for_terminal_input()\n        .context(\"Human input required - run this in a terminal\")?;\n\n    let selected_reviews = input\n        .prompt_multi_select(\n            \"Please select the reviews you want to target.\",\n            &branch_reviews,\n        )?\n        .ok_or_else(|| anyhow::anyhow!(\"Unable to determine which reviews to target\"))?\n        .into_iter()\n        .copied()\n        .collect::<Vec<_>>();\n\n    Ok(selected_reviews)\n}\n\nfn resolve_cli_ids_to_review_ids(\n    ctx: &mut Context,\n    selector: &str,\n    applied_stacks: &[HeadInfoStack],\n    id_map: &IdMap,\n) -> Vec<usize> {\n    parse_sources(ctx, id_map, selector)\n        .ok()\n        .unwrap_or_default()\n        .into_iter()\n        .filter_map(|cli_id| match cli_id {","sourceCodeStart":1233,"sourceCodeEnd":1269,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/forge/review.rs#L1233-L1269","documentation":"The review-targeting flow first requires at least one review (guarded by the earlier 'No reviews available to select' context) and then shows `prompt_multi_select(\"Please select the reviews you want to target.\", ...)`. A `None` return — the user cancelled the picker — becomes this error via `ok_or_else`, so no review is targeted.","triggerScenarios":"Running the review command for a branch that has reviews, reaching the multi-select, and cancelling it (Esc/Ctrl-C); `prompt_multi_select` returns None.","commonSituations":"User inspects the candidate reviews and decides to abort; terminal loses focus or resizes mid-prompt; automation accidentally inherits a TTY and the prompt gets killed.","solutions":["Re-run and select at least one review (Space to toggle, Enter to confirm)","Or target reviews non-interactively using the CLI id selectors the command accepts (see `but forge review --help`)","If the intent was to abort, nothing was modified — safe to ignore"],"exampleFix":"# before\nbut forge review\n# (cancel at 'Please select the reviews you want to target.')\n# error: Unable to determine which reviews to target\n\n# after\nbut forge review   # toggle reviews with Space, confirm with Enter","handlingStrategy":"fallback","validationCode":"# Skip the picker by passing review selectors on the command line\n# (the CLI resolves ids to reviews non-interactively; see but forge review --help)\nbut forge review <selector>","typeGuard":null,"tryCatchPattern":"# Distinguish cancellation from real failures in wrappers\nout=$(but forge review 2>&1); rc=$?\nif [ $rc -ne 0 ] && [[ \"$out\" == *\"Unable to determine which reviews\"* ]]; then exit 0; fi\necho \"$out\"; exit $rc","preventionTips":["Pass review ids explicitly in automation instead of relying on the picker","Treat picker cancellation as a clean exit — nothing was modified","Ensure automation runs without a TTY so the CLI asks for arguments instead"],"tags":["interactive","prompt","forge-review","selection"],"backgroundTag":"interactive-prompt-cancelled","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}