diff --git a/crates/agent/src/native_agent_server.rs b/crates/agent/src/native_agent_server.rs index e4e52445d98bdd76e40584c7d7cbcf2ba0c5e318..6ad3230d2c5d472dad1a72ef1c2a6e86e633fc32 100644 --- a/crates/agent/src/native_agent_server.rs +++ b/crates/agent/src/native_agent_server.rs @@ -34,19 +34,19 @@ impl AgentServer for NativeAgentServer { ui::IconName::ZedAgent } - fn local_login_commands(&self) -> Vec<&'static str> { + fn local_login_commands(&self) -> Vec { vec![] } - fn remote_login_commands(&self) -> Vec<&'static str> { + fn remote_login_commands(&self) -> Vec { vec![] } - fn local_logout_commands(&self) -> Vec<&'static str> { + fn local_logout_commands(&self) -> Vec { vec![] } - fn remote_logout_commands(&self) -> Vec<&'static str> { + fn remote_logout_commands(&self) -> Vec { vec![] } diff --git a/crates/agent_servers/src/agent_servers.rs b/crates/agent_servers/src/agent_servers.rs index 1ecbaddf21b8eec45650793e2fb46e6145a98435..a2ed9c168634c37d6399c3c4bcd5489a04e03ae1 100644 --- a/crates/agent_servers/src/agent_servers.rs +++ b/crates/agent_servers/src/agent_servers.rs @@ -71,22 +71,22 @@ pub trait AgentServer: Send { /// Returns the list of slash commands that should trigger Zed's authentication UI /// when running locally (e.g., "/login"). /// These commands will be intercepted by Zed to show the auth method selection UI. - fn local_login_commands(&self) -> Vec<&'static str>; + fn local_login_commands(&self) -> Vec; /// Returns the list of slash commands that should trigger Zed's authentication UI /// when running remotely (e.g., "/login"). /// These commands will be intercepted by Zed to show the auth method selection UI. - fn remote_login_commands(&self) -> Vec<&'static str>; + fn remote_login_commands(&self) -> Vec; /// Returns the list of logout-related slash commands that should be sent to the agent /// when running locally to let it reset internal state (e.g., "/logout"). /// These commands will be added to available_commands and passed through to the agent. - fn local_logout_commands(&self) -> Vec<&'static str>; + fn local_logout_commands(&self) -> Vec; /// Returns the list of logout-related slash commands that should be sent to the agent /// when running remotely to let it reset internal state (e.g., "/logout"). /// These commands will be added to available_commands and passed through to the agent. - fn remote_logout_commands(&self) -> Vec<&'static str>; + fn remote_logout_commands(&self) -> Vec; fn connect( &self, diff --git a/crates/agent_servers/src/claude.rs b/crates/agent_servers/src/claude.rs index c70b476d8d858de3b817e821b6a07d6415ad9ad5..0164378efa97cb65fae641c1b64d783bd4d4d883 100644 --- a/crates/agent_servers/src/claude.rs +++ b/crates/agent_servers/src/claude.rs @@ -56,20 +56,20 @@ impl AgentServer for ClaudeCode { }); } - fn local_login_commands(&self) -> Vec<&'static str> { - vec!["login"] + fn local_login_commands(&self) -> Vec { + vec!["login".to_string()] } - fn remote_login_commands(&self) -> Vec<&'static str> { - vec!["login"] + fn remote_login_commands(&self) -> Vec { + vec!["login".to_string()] } - fn local_logout_commands(&self) -> Vec<&'static str> { - vec!["logout"] + fn local_logout_commands(&self) -> Vec { + vec!["logout".to_string()] } - fn remote_logout_commands(&self) -> Vec<&'static str> { - vec!["logout"] + fn remote_logout_commands(&self) -> Vec { + vec!["logout".to_string()] } fn connect( diff --git a/crates/agent_servers/src/codex.rs b/crates/agent_servers/src/codex.rs index 4b53335be35530a49ffba5ba776df62fd5f65cd9..bd728649b6266f440de91b52c4d9bd081bf73660 100644 --- a/crates/agent_servers/src/codex.rs +++ b/crates/agent_servers/src/codex.rs @@ -36,19 +36,19 @@ impl AgentServer for Codex { ui::IconName::AiOpenAi } - fn local_login_commands(&self) -> Vec<&'static str> { + fn local_login_commands(&self) -> Vec { vec![] } - fn remote_login_commands(&self) -> Vec<&'static str> { + fn remote_login_commands(&self) -> Vec { vec![] } - fn local_logout_commands(&self) -> Vec<&'static str> { + fn local_logout_commands(&self) -> Vec { vec![] } - fn remote_logout_commands(&self) -> Vec<&'static str> { + fn remote_logout_commands(&self) -> Vec { vec![] } diff --git a/crates/agent_servers/src/custom.rs b/crates/agent_servers/src/custom.rs index 1912998401495fd8fa668a1616d43ffb1cdd1b3c..1dfddc9f5050c034f040f1d9cef87074cd90629c 100644 --- a/crates/agent_servers/src/custom.rs +++ b/crates/agent_servers/src/custom.rs @@ -34,19 +34,19 @@ impl crate::AgentServer for CustomAgentServer { IconName::Terminal } - fn local_login_commands(&self) -> Vec<&'static str> { + fn local_login_commands(&self) -> Vec { vec![] } - fn remote_login_commands(&self) -> Vec<&'static str> { + fn remote_login_commands(&self) -> Vec { vec![] } - fn local_logout_commands(&self) -> Vec<&'static str> { + fn local_logout_commands(&self) -> Vec { vec![] } - fn remote_logout_commands(&self) -> Vec<&'static str> { + fn remote_logout_commands(&self) -> Vec { vec![] } diff --git a/crates/agent_servers/src/gemini.rs b/crates/agent_servers/src/gemini.rs index b213b171f756e9dd700b9bb368049c0b7cf45861..59a8e154c4a738d77dd44a59ee584f2c5939a64f 100644 --- a/crates/agent_servers/src/gemini.rs +++ b/crates/agent_servers/src/gemini.rs @@ -25,21 +25,21 @@ impl AgentServer for Gemini { ui::IconName::AiGemini } - fn local_login_commands(&self) -> Vec<&'static str> { - vec!["login"] + fn local_login_commands(&self) -> Vec { + vec!["login".to_string()] } - fn remote_login_commands(&self) -> Vec<&'static str> { + fn remote_login_commands(&self) -> Vec { // When remote, OAuth doesn't work, so login is handled via the // auth_commands mapping (oauth-personal -> spawn-gemini-cli) vec![] } - fn local_logout_commands(&self) -> Vec<&'static str> { + fn local_logout_commands(&self) -> Vec { vec![] } - fn remote_logout_commands(&self) -> Vec<&'static str> { + fn remote_logout_commands(&self) -> Vec { vec![] } diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 2adc7cd728b1542f748cee877110635230b42966..26ba07855fb67b81d6469cad4d3b3f7229553f57 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -1067,12 +1067,12 @@ impl AcpThreadView { self.agent.local_logout_commands() }; let is_login_command = if let Some(cmd) = command_name { - login_commands.contains(&cmd) + login_commands.iter().any(|c| c == cmd) } else { false }; let is_logout_command = if let Some(cmd) = command_name { - logout_commands.contains(&cmd) + logout_commands.iter().any(|c| c == cmd) } else { false }; @@ -1464,7 +1464,7 @@ impl AcpThreadView { // Add login commands from the agent for command_name in login_commands { available_commands.push(acp::AvailableCommand { - name: command_name.to_string(), + name: command_name, description: "Authenticate".to_owned(), input: None, meta: None, @@ -1474,7 +1474,7 @@ impl AcpThreadView { // Add logout commands from the agent for command_name in logout_commands { available_commands.push(acp::AvailableCommand { - name: command_name.to_string(), + name: command_name, description: "Authenticate".to_owned(), input: None, meta: None, @@ -6050,19 +6050,19 @@ pub(crate) mod tests { "Test".into() } - fn local_login_commands(&self) -> Vec<&'static str> { + fn local_login_commands(&self) -> Vec { vec![] } - fn remote_login_commands(&self) -> Vec<&'static str> { + fn remote_login_commands(&self) -> Vec { vec![] } - fn local_logout_commands(&self) -> Vec<&'static str> { + fn local_logout_commands(&self) -> Vec { vec![] } - fn remote_logout_commands(&self) -> Vec<&'static str> { + fn remote_logout_commands(&self) -> Vec { vec![] }