Block nested review after replay

This commit is contained in:
Charlie Marsh
2026-06-29 21:25:59 -04:00
parent da66c4780e
commit 1bbbad1bca
2 changed files with 19 additions and 1 deletions

View File

@@ -141,7 +141,8 @@ impl ChatWidget {
fn slash_command_blocked_by_active_task(&self, cmd: SlashCommand) -> bool {
let foreground_work_active = self.bottom_pane.is_foreground_task_running()
|| (cmd == SlashCommand::Review
&& (self.input_queue.user_turn_pending_start
&& (self.review.is_review_mode
|| self.input_queue.user_turn_pending_start
|| self.has_queued_follow_up_messages()));
let blocked_by_task = if foreground_work_active {
!cmd.available_during_task()

View File

@@ -256,6 +256,23 @@ async fn replayed_active_review_keeps_mcp_startup_in_background() {
assert!(chat.mcp_startup_status.is_some());
}
#[tokio::test]
async fn replayed_active_review_blocks_nested_review_during_mcp_startup() {
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
chat.set_mcp_startup_expected_servers(["alpha".to_string()]);
replay_entered_review_mode(&mut chat, "current changes");
notify_mcp_status(&mut chat, "alpha", McpServerStartupState::Starting);
assert!(chat.review.is_review_mode);
assert!(!chat.bottom_pane.is_foreground_task_running());
assert_bare_review_rejected(
&mut chat,
&mut rx,
"'/review' is disabled while a task is in progress.",
);
assert!(op_rx.try_recv().is_err());
}
#[tokio::test]
async fn completed_replayed_review_does_not_hide_fresh_mcp_round() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;