diff --git a/crates/edit_prediction_cli/src/repair.rs b/crates/edit_prediction_cli/src/repair.rs index 4be087ae00ca5fc804140b385f4b01ff6f7d9663..d4d202708abc3234abc3bdb6b6ce3a506a06489d 100644 --- a/crates/edit_prediction_cli/src/repair.rs +++ b/crates/edit_prediction_cli/src/repair.rs @@ -134,6 +134,18 @@ fn build_score_feedback(example: &Example) -> Option { ); } + if score.discarded_chars.unwrap_or(0) > 80 && score.exact_lines_fp > 5 { + issues.push( + "Automated analysis detected that this prediction might be too large or speculative. \ + Please review it and think if we should keep it or generate a more focused prediction. \ + Examples of more focused predictions: \ + - Predicting a function outline but not its body. \ + - Predicting only the first logical step and not speculating about further steps. + In general, the smaller the prediction you make, the higher the chance it will be correct." + .to_string(), + ); + } + if issues.is_empty() { return None; }