mirror of
https://github.com/openai/codex.git
synced 2026-05-02 18:37:01 +00:00
fix: pending messages in /agent (#13240)
This commit is contained in:
@@ -1805,6 +1805,7 @@ async fn make_chatwidget_manual(
|
||||
current_status_header: String::from("Working"),
|
||||
retry_status_header: None,
|
||||
pending_status_indicator_restore: false,
|
||||
suppress_queue_autosend: false,
|
||||
thread_id: None,
|
||||
thread_name: None,
|
||||
forked_from: None,
|
||||
@@ -3367,6 +3368,30 @@ async fn empty_enter_during_task_does_not_queue() {
|
||||
assert!(chat.queued_user_messages.is_empty());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn restore_thread_input_state_syncs_sleep_inhibitor_state() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
chat.set_feature_enabled(Feature::PreventIdleSleep, true);
|
||||
|
||||
chat.restore_thread_input_state(Some(ThreadInputState {
|
||||
composer: None,
|
||||
queued_user_messages: VecDeque::new(),
|
||||
current_collaboration_mode: chat.current_collaboration_mode.clone(),
|
||||
active_collaboration_mask: chat.active_collaboration_mask.clone(),
|
||||
agent_turn_running: true,
|
||||
}));
|
||||
|
||||
assert!(chat.agent_turn_running);
|
||||
assert!(chat.turn_sleep_inhibitor.is_turn_running());
|
||||
assert!(chat.bottom_pane.is_task_running());
|
||||
|
||||
chat.restore_thread_input_state(None);
|
||||
|
||||
assert!(!chat.agent_turn_running);
|
||||
assert!(!chat.turn_sleep_inhibitor.is_turn_running());
|
||||
assert!(!chat.bottom_pane.is_task_running());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn alt_up_edits_most_recent_queued_message() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
Reference in New Issue
Block a user