diff --git a/Cargo.lock b/Cargo.lock index f04291074480c4acc0a6644b6143d5b21f6bdd19..e26a66ca8719c68fc4cee02fece16213a030e446 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,7 +277,6 @@ dependencies = [ "collections", "credentials_provider", "env_logger 0.11.8", - "feature_flags", "fs", "futures 0.3.31", "google_ai", diff --git a/crates/acp_thread/src/connection.rs b/crates/acp_thread/src/connection.rs index f8f9afc4c0d738c4775981ba48c0c617bfdb897b..0becded53762be7c96789b0d31191fd9cbc02bfe 100644 --- a/crates/acp_thread/src/connection.rs +++ b/crates/acp_thread/src/connection.rs @@ -38,7 +38,7 @@ pub trait AgentConnection { ) -> Task>>; /// Whether this agent supports loading existing sessions. - fn supports_load_session(&self, _cx: &App) -> bool { + fn supports_load_session(&self) -> bool { false } @@ -54,7 +54,7 @@ pub trait AgentConnection { } /// Whether this agent supports closing existing sessions. - fn supports_close_session(&self, _cx: &App) -> bool { + fn supports_close_session(&self) -> bool { false } @@ -64,7 +64,7 @@ pub trait AgentConnection { } /// Whether this agent supports resuming existing sessions without loading history. - fn supports_resume_session(&self, _cx: &App) -> bool { + fn supports_resume_session(&self) -> bool { false } @@ -82,8 +82,8 @@ pub trait AgentConnection { } /// Whether this agent supports showing session history. - fn supports_session_history(&self, cx: &App) -> bool { - self.supports_load_session(cx) || self.supports_resume_session(cx) + fn supports_session_history(&self) -> bool { + self.supports_load_session() || self.supports_resume_session() } fn auth_methods(&self) -> &[acp::AuthMethod]; diff --git a/crates/agent/src/agent.rs b/crates/agent/src/agent.rs index 5a318bbe3981302b235138a43466d0692bec88d3..80649e406595027f95c61ec844d496c32d41fd07 100644 --- a/crates/agent/src/agent.rs +++ b/crates/agent/src/agent.rs @@ -1247,7 +1247,7 @@ impl acp_thread::AgentConnection for NativeAgentConnection { .update(cx, |agent, cx| agent.new_session(project, cx)))) } - fn supports_load_session(&self, _cx: &App) -> bool { + fn supports_load_session(&self) -> bool { true } @@ -1262,7 +1262,7 @@ impl acp_thread::AgentConnection for NativeAgentConnection { .update(cx, |agent, cx| agent.open_thread(session.session_id, cx)) } - fn supports_close_session(&self, _cx: &App) -> bool { + fn supports_close_session(&self) -> bool { true } diff --git a/crates/agent_servers/Cargo.toml b/crates/agent_servers/Cargo.toml index 391e37d9e7b0d7145e74ccecf7ac698b5b4d7a74..4d34632a248c5db35666e93cb068c7ec6727fc48 100644 --- a/crates/agent_servers/Cargo.toml +++ b/crates/agent_servers/Cargo.toml @@ -21,7 +21,6 @@ acp_tools.workspace = true acp_thread.workspace = true action_log.workspace = true agent-client-protocol.workspace = true -feature_flags.workspace = true anyhow.workspace = true async-trait.workspace = true chrono.workspace = true diff --git a/crates/agent_servers/src/acp.rs b/crates/agent_servers/src/acp.rs index 7617646d038e9bb7da07de07f62f560b44ec7571..b106aaf836b0c4063a9909d9b81a0b652fb67155 100644 --- a/crates/agent_servers/src/acp.rs +++ b/crates/agent_servers/src/acp.rs @@ -7,7 +7,6 @@ use action_log::ActionLog; use agent_client_protocol::{self as acp, Agent as _, ErrorCode}; use anyhow::anyhow; use collections::HashMap; -use feature_flags::{AcpBetaFeatureFlag, FeatureFlagAppExt as _}; use futures::AsyncBufReadExt as _; use futures::io::BufReader; use project::Project; @@ -585,17 +584,15 @@ impl AgentConnection for AcpConnection { }) } - fn supports_load_session(&self, cx: &App) -> bool { - cx.has_flag::() && self.agent_capabilities.load_session + fn supports_load_session(&self) -> bool { + self.agent_capabilities.load_session } - fn supports_resume_session(&self, cx: &App) -> bool { - cx.has_flag::() - && self - .agent_capabilities - .session_capabilities - .resume - .is_some() + fn supports_resume_session(&self) -> bool { + self.agent_capabilities + .session_capabilities + .resume + .is_some() } fn load_session( @@ -605,7 +602,7 @@ impl AgentConnection for AcpConnection { cwd: &Path, cx: &mut App, ) -> Task>> { - if !cx.has_flag::() || !self.agent_capabilities.load_session { + if !self.agent_capabilities.load_session { return Task::ready(Err(anyhow!(LoadError::Other( "Loading sessions is not supported by this agent.".into() )))); @@ -673,12 +670,11 @@ impl AgentConnection for AcpConnection { cwd: &Path, cx: &mut App, ) -> Task>> { - if !cx.has_flag::() - || self - .agent_capabilities - .session_capabilities - .resume - .is_none() + if self + .agent_capabilities + .session_capabilities + .resume + .is_none() { return Task::ready(Err(anyhow!(LoadError::Other( "Resuming sessions is not supported by this agent.".into() @@ -887,12 +883,8 @@ impl AgentConnection for AcpConnection { }) as _) } - fn session_list(&self, cx: &mut App) -> Option> { - if cx.has_flag::() { - self.session_list.clone().map(|s| s as _) - } else { - None - } + fn session_list(&self, _cx: &mut App) -> Option> { + self.session_list.clone().map(|s| s as _) } fn into_any(self: Rc) -> Rc { diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 5c9b9e639e3e49c744fc21b8bb520b3d63f741ba..41e0548efe4cf2191337e4d1c962b0a764bb2316 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -491,11 +491,11 @@ impl AcpServerView { let mut resumed_without_history = false; let result = if let Some(resume) = resume_thread.clone() { cx.update(|_, cx| { - if connection.supports_load_session(cx) { + if connection.supports_load_session() { connection .clone() .load_session(resume, project.clone(), &session_cwd, cx) - } else if connection.supports_resume_session(cx) { + } else if connection.supports_resume_session() { resumed_without_history = true; connection .clone() @@ -666,7 +666,7 @@ impl AcpServerView { let connection = thread.read(cx).connection().clone(); let session_id = thread.read(cx).session_id().clone(); - let session_list = if connection.supports_session_history(cx) { + let session_list = if connection.supports_session_history() { connection.session_list(cx) } else { None @@ -1485,7 +1485,7 @@ impl AcpServerView { return; }; if connected.threads.contains_key(&subagent_id) - || !connected.connection.supports_load_session(cx) + || !connected.connection.supports_load_session() { return; } @@ -3519,7 +3519,7 @@ pub(crate) mod tests { Task::ready(Ok(thread)) } - fn supports_resume_session(&self, _cx: &App) -> bool { + fn supports_resume_session(&self) -> bool { true } @@ -3847,7 +3847,7 @@ pub(crate) mod tests { Task::ready(Ok(thread)) } - fn supports_load_session(&self, _cx: &App) -> bool { + fn supports_load_session(&self) -> bool { true }