fix(tui/esc): keep cancelable agents prioritized

This commit is contained in:
James Peter
2026-01-05 15:01:46 +10:00
parent 67c2c0fa24
commit 195c768eb1
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -30062,6 +30062,7 @@ use code_core::protocol::OrderMeta;
assert_eq!(route.intent, EscIntent::CancelAgents);
assert!(chat.execute_esc_intent(route.intent, esc_event));
assert!(!chat.auto_state.is_active());
assert!(chat.has_cancelable_agents());
assert!(chat.auto_state.last_run_summary.is_none());
}
@@ -30168,7 +30169,7 @@ use code_core::protocol::OrderMeta;
assert!(chat.auto_state.last_run_summary.is_none());
let route = chat.describe_esc_context();
assert_eq!(route.intent, EscIntent::AutoGoalExitPreserveDraft);
assert_eq!(route.intent, EscIntent::CancelAgents);
}
#[allow(dead_code)]
+4 -4
View File
@@ -139,6 +139,10 @@ impl ChatWidget<'_> {
return EscRoute::new(EscIntent::AutoStopActive, true, false);
}
if self.has_cancelable_agents() {
return EscRoute::new(EscIntent::CancelAgents, true, false);
}
if self.auto_state.should_show_goal_entry() {
return EscRoute::new(
match self.auto_goal_escape_state {
@@ -151,10 +155,6 @@ impl ChatWidget<'_> {
);
}
if self.has_cancelable_agents() {
return EscRoute::new(EscIntent::CancelAgents, true, false);
}
if self.auto_state.last_run_summary.is_some() {
return EscRoute::new(EscIntent::AutoDismissSummary, true, false);
}