mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Arm MCP suppression when review is submitted
This commit is contained in:
@@ -215,6 +215,7 @@ impl ChatWidget {
|
||||
}
|
||||
|
||||
pub(super) fn skip_mcp_startup_for_review(&mut self) {
|
||||
self.mcp_startup_updates_suppressed_for_review = true;
|
||||
if self.mcp_startup_status.is_none() {
|
||||
return;
|
||||
}
|
||||
@@ -225,7 +226,6 @@ impl ChatWidget {
|
||||
self.mcp_startup_allow_terminal_only_next_round = false;
|
||||
self.mcp_startup_pending_next_round.clear();
|
||||
self.mcp_startup_pending_next_round_saw_starting = false;
|
||||
self.mcp_startup_updates_suppressed_for_review = true;
|
||||
if mcp_startup_owned_status {
|
||||
self.set_status_header(String::from("Working"));
|
||||
}
|
||||
|
||||
@@ -130,6 +130,26 @@ async fn skipped_mcp_startup_updates_do_not_reopen_or_finish_review_task() {
|
||||
assert!(chat.mcp_startup_status.is_some());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn review_before_first_mcp_update_suppresses_startup_round() {
|
||||
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.set_mcp_startup_expected_servers(["alpha".to_string()]);
|
||||
|
||||
chat.dispatch_command_with_args(
|
||||
SlashCommand::Review,
|
||||
"check regressions".to_string(),
|
||||
Vec::new(),
|
||||
);
|
||||
assert_matches!(op_rx.try_recv(), Ok(Op::Review { .. }));
|
||||
|
||||
notify_mcp_status(&mut chat, "alpha", McpServerStartupState::Starting);
|
||||
notify_mcp_status(&mut chat, "alpha", McpServerStartupState::Ready);
|
||||
|
||||
assert!(chat.mcp_startup_status.is_none());
|
||||
assert!(chat.bottom_pane.is_task_running());
|
||||
assert_eq!(chat.status_state.current_status.header, "Working");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn review_command_remains_blocked_during_agent_turn() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in New Issue
Block a user