Prevent duplicate command monitor timers

This commit is contained in:
2026-08-06 16:17:38 -05:00
parent 57c7c54d5d
commit fbbf90e2fb
3 changed files with 50 additions and 3 deletions
+21
View File
@@ -106,6 +106,27 @@ fn has_pending_user_query_block(view: &TerminalView) -> bool {
})
}
#[test]
fn automatic_command_monitor_start_is_deduplicated_per_block() {
let mut pending_starts = HashSet::new();
let block_id = BlockId::new();
assert!(super::register_command_monitor_start(
&mut pending_starts,
&block_id
));
assert!(!super::register_command_monitor_start(
&mut pending_starts,
&block_id
));
pending_starts.remove(&block_id);
assert!(super::register_command_monitor_start(
&mut pending_starts,
&block_id
));
}
#[test]
fn agent_view_lifecycle_updates_input_mode() {
App::test((), |mut app| async move {