diff --git a/crates/agent_servers/src/acp.rs b/crates/agent_servers/src/acp.rs index b14c0467c58d3f41e32e602996560e2cc672d76a..07dd4214055180a1f1887294a5ab5c4cdd42a0f5 100644 --- a/crates/agent_servers/src/acp.rs +++ b/crates/agent_servers/src/acp.rs @@ -1,7 +1,7 @@ use acp_thread::AgentConnection; use acp_tools::AcpConnectionRegistry; use action_log::ActionLog; -use agent_client_protocol::{self as acp, Agent as _, ErrorCode}; +use agent_client_protocol::{self as acp, Agent as _}; use anyhow::anyhow; use collections::HashMap; use futures::AsyncBufReadExt as _; @@ -380,7 +380,7 @@ impl AgentConnection for AcpConnection { match result { Ok(response) => Ok(response), Err(err) => { - if err.code != ErrorCode::INTERNAL_ERROR.code { + if err.code != acp::ErrorCode::INTERNAL_ERROR.code { anyhow::bail!(err) } diff --git a/crates/agent_servers/src/codex.rs b/crates/agent_servers/src/codex.rs index e77b5d1611a2fac4ee7ac28681795947c44bc72e..e48e1f4fbdb2d79168e611a416c7154af504e7bd 100644 --- a/crates/agent_servers/src/codex.rs +++ b/crates/agent_servers/src/codex.rs @@ -1,4 +1,3 @@ -use agent_client_protocol as acp; use std::rc::Rc; use std::{any::Any, path::Path}; diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 5e402e60777071f64db091e4ccaa545b651a3fc3..544a609ededcdbf27205f26a66c5587c4dbc0be0 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -1015,7 +1015,7 @@ impl AcpThreadView { let auth_methods = connection.auth_methods(); let has_supported_auth = auth_methods.iter().any(|method| { let id = method.id.0.as_ref(); - id == "claude-login" || id == "spawn-gemini-cli" || id == "spawn-codex-acp" + id == "claude-login" || id == "spawn-gemini-cli" }); let can_login = has_supported_auth || auth_methods.is_empty() || self.login.is_some(); if !can_login { @@ -1519,8 +1519,7 @@ impl AcpThreadView { configuration_view.take(); pending_auth_method.replace(method.clone()); let authenticate = if (method.0.as_ref() == "claude-login" - || method.0.as_ref() == "spawn-gemini-cli" - || method.0.as_ref() == "spawn-codex-acp") + || method.0.as_ref() == "spawn-gemini-cli") && let Some(login) = self.login.clone() { if let Some(workspace) = self.workspace.upgrade() { diff --git a/crates/project/src/agent_server_store.rs b/crates/project/src/agent_server_store.rs index 0398ec84b5ed005cf958e182562f750f23dde3f1..c17f4cbdbb35ec2e007fb09fdf09b72bc9f19946 100644 --- a/crates/project/src/agent_server_store.rs +++ b/crates/project/src/agent_server_store.rs @@ -1004,10 +1004,10 @@ impl ExternalAgentServer for LocalCodex { .await .unwrap_or_default(); - let (mut command, login) = if let Some(mut custom_command) = custom_command { + let mut command = if let Some(mut custom_command) = custom_command { env.extend(custom_command.env.unwrap_or_default()); custom_command.env = Some(env); - (custom_command, None) + custom_command } else { let dir = paths::data_dir().join("external_agents").join(CODEX_NAME); fs.create_dir(&dir).await?; @@ -1058,7 +1058,7 @@ impl ExternalAgentServer for LocalCodex { // Decompress and extract the tar.gz into the version directory. let reader = futures::io::BufReader::new(response.body_mut()); let decoder = async_compression::futures::bufread::GzipDecoder::new(reader); - let mut archive = async_tar::Archive::new(decoder); + let archive = async_tar::Archive::new(decoder); archive .unpack(&version_dir) .await @@ -1083,11 +1083,11 @@ impl ExternalAgentServer for LocalCodex { env: None, }; cmd.env = Some(env); - (cmd, None) + cmd }; command.env.get_or_insert_default().extend(extra_env); - Ok((command, root_dir.to_string_lossy().into_owned(), login)) + Ok((command, root_dir.to_string_lossy().into_owned(), None)) }) }