Avoid spawning external agent process when AI is disabled at startup (#39649)

Closes #39645 

Release Notes:

- Fixed external agent servers sometimes being spawned when Zed started
even when AI was disabled.
This commit is contained in:
Cole Miller
2025-10-07 01:01:17 +00:00
committed by GitHub
parent c1e917165d
commit f6f11eb544
2 changed files with 16 additions and 3 deletions
+6 -1
View File
@@ -82,7 +82,7 @@ impl AcpConnection {
is_remote: bool,
cx: &mut AsyncApp,
) -> Result<Self> {
let mut child = util::command::new_smol_command(command.path);
let mut child = util::command::new_smol_command(&command.path);
child
.args(command.args.iter().map(|arg| arg.as_str()))
.envs(command.env.iter().flatten())
@@ -97,6 +97,11 @@ impl AcpConnection {
let stdout = child.stdout.take().context("Failed to take stdout")?;
let stdin = child.stdin.take().context("Failed to take stdin")?;
let stderr = child.stderr.take().context("Failed to take stderr")?;
log::info!(
"Spawning external agent server: {:?}, {:?}",
command.path,
command.args
);
log::trace!("Spawned (pid: {})", child.id());
let sessions = Rc::new(RefCell::new(HashMap::default()));