mirror of
https://github.com/openai/codex.git
synced 2026-05-03 21:01:55 +03:00
chore: dedup review result duplication (#8057)
This commit is contained in:
@@ -33,10 +33,6 @@ use codex_core::protocol::Op;
|
||||
use codex_core::protocol::PatchApplyBeginEvent;
|
||||
use codex_core::protocol::PatchApplyEndEvent;
|
||||
use codex_core::protocol::RateLimitWindow;
|
||||
use codex_core::protocol::ReviewCodeLocation;
|
||||
use codex_core::protocol::ReviewFinding;
|
||||
use codex_core::protocol::ReviewLineRange;
|
||||
use codex_core::protocol::ReviewOutputEvent;
|
||||
use codex_core::protocol::ReviewRequest;
|
||||
use codex_core::protocol::ReviewTarget;
|
||||
use codex_core::protocol::StreamErrorEvent;
|
||||
@@ -195,41 +191,6 @@ fn entered_review_mode_defaults_to_current_changes_banner() {
|
||||
assert!(chat.is_review_mode);
|
||||
}
|
||||
|
||||
/// Completing review with findings shows the selection popup and finishes with
|
||||
/// the closing banner while clearing review mode state.
|
||||
#[test]
|
||||
fn exited_review_mode_emits_results_and_finishes() {
|
||||
let (mut chat, mut rx, _ops) = make_chatwidget_manual(None);
|
||||
|
||||
let review = ReviewOutputEvent {
|
||||
findings: vec![ReviewFinding {
|
||||
title: "[P1] Fix bug".to_string(),
|
||||
body: "Something went wrong".to_string(),
|
||||
confidence_score: 0.9,
|
||||
priority: 1,
|
||||
code_location: ReviewCodeLocation {
|
||||
absolute_file_path: PathBuf::from("src/lib.rs"),
|
||||
line_range: ReviewLineRange { start: 10, end: 12 },
|
||||
},
|
||||
}],
|
||||
overall_correctness: "needs work".to_string(),
|
||||
overall_explanation: "Investigate the failure".to_string(),
|
||||
overall_confidence_score: 0.5,
|
||||
};
|
||||
|
||||
chat.handle_codex_event(Event {
|
||||
id: "review-end".into(),
|
||||
msg: EventMsg::ExitedReviewMode(ExitedReviewModeEvent {
|
||||
review_output: Some(review),
|
||||
}),
|
||||
});
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
let banner = lines_to_single_string(cells.last().expect("finished banner"));
|
||||
assert_eq!(banner, "\n<< Code review finished >>\n");
|
||||
assert!(!chat.is_review_mode);
|
||||
}
|
||||
|
||||
/// Exiting review restores the pre-review context window indicator.
|
||||
#[test]
|
||||
fn review_restores_context_window_indicator() {
|
||||
|
||||
Reference in New Issue
Block a user