{"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":1249,"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":1231,"sourceCodeEnd":1267,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/forge/review.rs#L1231-L1267","documentation":"interactive_review_id_selection throws this when the multi-select prompt for choosing which existing reviews to target yields no selection. Without a user-chosen set of review IDs, the command cannot know which reviews to act on, so it aborts.","triggerScenarios":"Running a review-targeting command that resolves multiple candidate reviews, entering the interactive prompt, and aborting (Esc/Ctrl+C) or confirming with nothing selected.","commonSituations":"Users changing their mind mid-prompt, terminal multiplexers intercepting Esc keys, or non-TTY environments degrading the multi-select into a no-op.","solutions":["Re-run and select at least one review in the prompt","Specify the target review IDs explicitly via command line arguments if supported","Ensure the terminal is a real TTY so the multi-select renders and captures input correctly"],"exampleFix":"// before\nbut forge review  # aborted selection prompt\n// after\nbut forge review --id 42  # explicit target, no prompt","handlingStrategy":"try-catch","validationCode":"// resolve reviews non-interactively where possible\nif (reviewIds.length === 0) {\n  throw new Error('No reviews to target');\n}\nawait runBut(['forge', 'review', ...reviewIds]);","typeGuard":"function hasReviewSelection<T>(sel: readonly T[] | null): sel is readonly T[] {\n  return sel !== null && sel.length > 0;\n}","tryCatchPattern":"try {\n  await runBut(['forge', 'review']);\n} catch (e) {\n  if (/Unable to determine which reviews/.test(e.message)) {\n    console.warn('Review targeting aborted by user');\n    return;\n  }\n  throw e;\n}","preventionTips":["Pass review IDs explicitly to avoid the multi-select","Run commands in a proper TTY so prompts render","Treat empty prompt selection as an intentional abort"],"tags":["cli","interactive","user-abort","review-selection"],"backgroundTag":"missing-required-argument","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}