Merge 9e499bb29b into sapling-pr-archive-bolinfest

This commit is contained in:
Michael Bolin
2026-04-01 20:05:55 -07:00
committed by GitHub
2 changed files with 20 additions and 1 deletions

View File

@@ -160,6 +160,7 @@ fn command_assessment_action(
}
}
#[cfg(unix)]
fn guardian_command_source_tool_name(source: GuardianCommandSource) -> &'static str {
match source {
GuardianCommandSource::Shell => "shell",

View File

@@ -2202,7 +2202,7 @@ impl App {
match op.view() {
AppCommandView::Interrupt => {
let Some(turn_id) = self.active_turn_id_for_thread(thread_id).await else {
return Ok(false);
return Ok(true);
};
app_server.turn_interrupt(thread_id, turn_id).await?;
Ok(true)
@@ -10663,6 +10663,24 @@ guardian_approval = true
);
}
#[tokio::test]
async fn interrupt_without_active_turn_is_treated_as_handled() {
let mut app = make_test_app().await;
let thread_id = ThreadId::new();
let mut app_server =
crate::start_embedded_app_server_for_picker(app.chat_widget.config_ref())
.await
.expect("embedded app server");
let op = AppCommand::interrupt();
let handled = app
.try_submit_active_thread_op_via_app_server(&mut app_server, thread_id, &op)
.await
.expect("interrupt submission should not fail");
assert_eq!(handled, true);
}
#[tokio::test]
async fn clear_only_ui_reset_preserves_chat_session_state() {
let mut app = make_test_app().await;