fix: pending messages in /agent (#13240)

This commit is contained in:
jif-oai
2026-03-04 10:17:29 +00:00
committed by GitHub
parent 49634b7f9c
commit e4a202ea52
5 changed files with 960 additions and 7 deletions

View File

@@ -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;