Clear pending turn start on interrupt

This commit is contained in:
pakrym-oai
2026-05-21 17:43:27 -07:00
parent d68c3b374e
commit 75e6b3c337
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -161,6 +161,12 @@ impl InputQueue {
.extend(input.into_iter().map(PendingInput::new));
}
pub(crate) async fn clear_start_turn(&self) {
for pending_input in &mut self.state.lock().await.turn_pending_input {
pending_input.start_turn = false;
}
}
#[expect(
clippy::await_holding_invalid_type,
reason = "active turn checks and turn state updates must remain atomic"
+1
View File
@@ -3229,6 +3229,7 @@ impl Session {
pub async fn interrupt_task(self: &Arc<Self>) {
info!("interrupt received: abort current task, if any");
let had_active_turn = self.active_turn.lock().await.is_some();
self.input_queue.clear_start_turn().await;
self.abort_all_tasks(TurnAbortReason::Interrupted).await;
if !had_active_turn {
self.cancel_mcp_startup().await;