mirror of
https://github.com/openai/codex.git
synced 2026-10-24 18:18:41 +00:00
Clear rejected review attachments when not deferred
This commit is contained in:
@@ -1167,7 +1167,9 @@ impl ChatWidget {
|
||||
}
|
||||
|
||||
fn handle_rejected_slash_command_state(&mut self, cmd: SlashCommand) {
|
||||
if !cmd.available_during_background_task_only() {
|
||||
if !cmd.available_during_background_task_only()
|
||||
|| !self.bottom_pane.is_mcp_startup_running()
|
||||
{
|
||||
self.bottom_pane.drain_pending_submission_state();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,6 +364,26 @@ async fn side_conversation_rejection_preserves_review_draft_during_mcp_startup()
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn side_conversation_rejection_without_mcp_clears_review_attachments() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.set_side_conversation_active(/*active*/ true);
|
||||
chat.set_remote_image_urls(vec!["https://example.com/review-context.png".to_string()]);
|
||||
|
||||
submit_bare_review(&mut chat);
|
||||
|
||||
let error = drain_insert_history(&mut rx)
|
||||
.into_iter()
|
||||
.map(|lines| lines_to_single_string(&lines))
|
||||
.collect::<String>();
|
||||
assert!(
|
||||
error.contains("'/review' is unavailable in side conversations."),
|
||||
"unexpected error: {error}"
|
||||
);
|
||||
assert_eq!(chat.bottom_pane.composer_text(), "");
|
||||
assert_eq!(chat.remote_image_urls(), Vec::<String>::new());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn mcp_startup_dedupes_same_round_duplicate_failure_warning() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in New Issue
Block a user