mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:00:42 +00:00
Preserve rejected review draft attachments
This commit is contained in:
@@ -168,7 +168,7 @@ impl ChatWidget {
|
||||
cmd.command()
|
||||
);
|
||||
self.add_to_history(history_cell::new_error_event(message));
|
||||
self.bottom_pane.drain_pending_submission_state();
|
||||
self.handle_rejected_slash_command_state(cmd);
|
||||
self.request_redraw();
|
||||
return;
|
||||
}
|
||||
@@ -1148,7 +1148,7 @@ impl ChatWidget {
|
||||
"'/{}' is unavailable in side conversations. {SIDE_SLASH_COMMAND_UNAVAILABLE_HINT}",
|
||||
cmd.command()
|
||||
));
|
||||
self.bottom_pane.drain_pending_submission_state();
|
||||
self.handle_rejected_slash_command_state(cmd);
|
||||
false
|
||||
}
|
||||
|
||||
@@ -1161,7 +1161,13 @@ impl ChatWidget {
|
||||
self.add_error_message(format!(
|
||||
"'/{command}' is unavailable while code review is running."
|
||||
));
|
||||
self.bottom_pane.drain_pending_submission_state();
|
||||
self.handle_rejected_slash_command_state(cmd);
|
||||
false
|
||||
}
|
||||
|
||||
fn handle_rejected_slash_command_state(&mut self, cmd: SlashCommand) {
|
||||
if !cmd.available_during_background_task_only() {
|
||||
self.bottom_pane.drain_pending_submission_state();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,12 +333,15 @@ async fn queued_prompt_blocks_review_during_mcp_startup() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
notify_mcp_status(&mut chat, "alpha", McpServerStartupState::Starting);
|
||||
chat.queue_user_message("queued prompt".into());
|
||||
let attachment = "https://example.com/review-context.png".to_string();
|
||||
chat.set_remote_image_urls(vec![attachment.clone()]);
|
||||
|
||||
assert_bare_review_rejected(
|
||||
&mut chat,
|
||||
&mut rx,
|
||||
"'/review' is disabled while a task is in progress.",
|
||||
);
|
||||
assert_eq!(chat.remote_image_urls(), vec![attachment]);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user