From b5450651d14508024f3ba8024fc3a227dc5fe177 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 24 Aug 2026 12:33:39 +0100 Subject: [PATCH] test(maestro): expose forced kill and retained-worktree calls in the e2e harness --- crates/maestro-e2e/src/client.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/maestro-e2e/src/client.rs b/crates/maestro-e2e/src/client.rs index f89cd2c..6ba4410 100644 --- a/crates/maestro-e2e/src/client.rs +++ b/crates/maestro-e2e/src/client.rs @@ -12,7 +12,8 @@ use std::time::Duration; use futures_util::{SinkExt, StreamExt}; use maestro_protocol::{ - BranchInfo, CatalogEvent, CreateSessionRequest, DaemonClient, Project, Session, + BranchInfo, CatalogEvent, CreateSessionRequest, DaemonClient, KillOutcome, Project, + RetainedWorktree, Session, }; use tokio_tungstenite::tungstenite::client::IntoClientRequest; use tokio_tungstenite::tungstenite::Message as WsMessage; @@ -64,6 +65,20 @@ impl TestClient { Ok(self.daemon.kill_session(id, false).await.map(|_| ())?) } + /// Kill with `force=true`: overrides a kill refusal and retains the + /// guarded worktree (#81). Answers with what was kept. + pub async fn kill_session_forced(&self, id: Uuid) -> Result { + Ok(self.daemon.kill_session(id, true).await?) + } + + pub async fn list_worktrees(&self) -> Result, ClientError> { + Ok(self.daemon.list_worktrees().await?) + } + + pub async fn reclaim_worktree(&self, id: Uuid) -> Result<(), ClientError> { + Ok(self.daemon.reclaim_worktree(id).await?) + } + pub async fn list_projects(&self) -> Result, ClientError> { Ok(self.daemon.list_projects().await?) }