Skip to content

Commit e6fbcf1

Browse files
committed
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
1 parent 98e2d3e commit e6fbcf1

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

crates/agent_servers/src/gemini.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl AgentServer for Gemini {
3939
}
4040

4141
fn install_command(&self) -> Option<&'static str> {
42-
Some("npm install -g @google/gemini-cli@latest")
42+
Some("npm install --engine-strict -g @google/gemini-cli@latest")
4343
}
4444

4545
fn connect(
@@ -141,7 +141,7 @@ impl Gemini {
141141
}
142142

143143
pub fn install_command() -> &'static str {
144-
"npm install -g @google/gemini-cli@latest"
144+
"npm install --engine-strict -g @google/gemini-cli@latest"
145145
}
146146

147147
pub fn upgrade_command() -> &'static str {

crates/agent_ui/src/acp/thread_view.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,10 +2913,17 @@ impl AcpThreadView {
29132913
if let Some((path, version)) = existing_version {
29142914
(
29152915
format!("Upgrade {} to work with Zed", self.agent.name()),
2916-
format!(
2917-
"Currently using {}, which is only version {}",
2918-
path, version
2919-
),
2916+
if version.is_empty() {
2917+
format!(
2918+
"Currently using {}, which does not report a valid --version",
2919+
path,
2920+
)
2921+
} else {
2922+
format!(
2923+
"Currently using {}, which is only version {}",
2924+
path, version
2925+
)
2926+
},
29202927
format!("Upgrade {}", self.agent.name()),
29212928
)
29222929
} else {
@@ -2966,6 +2973,13 @@ impl AcpThreadView {
29662973
self.install_command_markdown.clone(),
29672974
default_markdown_style(false, false, window, cx),
29682975
))
2976+
.when_some(existing_version, |el, (path, _)| {
2977+
el.child(
2978+
Label::new(format!("If this does not work you will need to upgrade manually, or uninstall your existing version from {}", path))
2979+
.size(LabelSize::Small)
2980+
.color(Color::Muted),
2981+
)
2982+
})
29692983
.into_any_element()
29702984
}
29712985

0 commit comments

Comments
 (0)