From f4071bdd8ea2a3914f169cd3ec4578541b684de0 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 27 Aug 2025 00:24:56 -0600 Subject: [PATCH] acp: Upgrade errors (#36980) - **Pass --engine-strict to gemini install command** - **Make it clearer that if upgrading fails, you need to fix i** Closes #ISSUE Release Notes: - N/A --- crates/agent_servers/src/gemini.rs | 4 ++-- crates/agent_ui/src/acp/thread_view.rs | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/crates/agent_servers/src/gemini.rs b/crates/agent_servers/src/gemini.rs index 33d92060a49ccb79fd12605f2089bfa0a9d65608..6d17cc0512d382f9b1a550dcb978957318de0d74 100644 --- a/crates/agent_servers/src/gemini.rs +++ b/crates/agent_servers/src/gemini.rs @@ -39,7 +39,7 @@ impl AgentServer for Gemini { } fn install_command(&self) -> Option<&'static str> { - Some("npm install -g @google/gemini-cli@latest") + Some("npm install --engine-strict -g @google/gemini-cli@latest") } fn connect( @@ -141,7 +141,7 @@ impl Gemini { } pub fn install_command() -> &'static str { - "npm install -g @google/gemini-cli@latest" + "npm install --engine-strict -g @google/gemini-cli@latest" } pub fn upgrade_command() -> &'static str { diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 54d3421c3bff63bccf2b2cdeaa9dfb509dd7b96b..70d32088c549955a82323ac13d068943d65e6853 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -2913,10 +2913,17 @@ impl AcpThreadView { if let Some((path, version)) = existing_version { ( format!("Upgrade {} to work with Zed", self.agent.name()), - format!( - "Currently using {}, which is only version {}", - path, version - ), + if version.is_empty() { + format!( + "Currently using {}, which does not report a valid --version", + path, + ) + } else { + format!( + "Currently using {}, which is only version {}", + path, version + ) + }, format!("Upgrade {}", self.agent.name()), ) } else { @@ -2966,6 +2973,13 @@ impl AcpThreadView { self.install_command_markdown.clone(), default_markdown_style(false, false, window, cx), )) + .when_some(existing_version, |el, (path, _)| { + el.child( + Label::new(format!("If this does not work you will need to upgrade manually, or uninstall your existing version from {}", path)) + .size(LabelSize::Small) + .color(Color::Muted), + ) + }) .into_any_element() }