From cb52acbf3dfd621e2e6e1977f023b677ff893bea Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 22 May 2025 20:21:35 -0400 Subject: [PATCH] eval: Don't read the model from the user settings (#31230) This PR fixes an issue where the eval was incorrectly pulling the provider/model from the user settings, which could cause problems when running certain evals. Was introduced in #30168 due to the restructuring after the removal of the `assistant` crate. Release Notes: - N/A --- crates/agent/src/agent.rs | 7 ++++++- crates/eval/src/eval.rs | 1 + crates/zed/src/main.rs | 1 + crates/zed/src/zed.rs | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/agent/src/agent.rs b/crates/agent/src/agent.rs index 95ceb26c4f..f0e4365bae 100644 --- a/crates/agent/src/agent.rs +++ b/crates/agent/src/agent.rs @@ -117,6 +117,7 @@ pub fn init( client: Arc, prompt_builder: Arc, language_registry: Arc, + is_eval: bool, cx: &mut App, ) { AssistantSettings::register(cx); @@ -124,7 +125,11 @@ pub fn init( assistant_context_editor::init(client.clone(), cx); rules_library::init(cx); - init_language_model_settings(cx); + if !is_eval { + // Initializing the language model from the user settings messes with the eval, so we only initialize them when + // we're not running inside of the eval. + init_language_model_settings(cx); + } assistant_slash_command::init(cx); thread_store::init(cx); agent_panel::init(cx); diff --git a/crates/eval/src/eval.rs b/crates/eval/src/eval.rs index f42d138f28..064a0c688e 100644 --- a/crates/eval/src/eval.rs +++ b/crates/eval/src/eval.rs @@ -432,6 +432,7 @@ pub fn init(cx: &mut App) -> Arc { client.clone(), prompt_builder.clone(), languages.clone(), + true, cx, ); assistant_tools::init(client.http_client(), cx); diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 99fa59ee72..1bdef5456c 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -519,6 +519,7 @@ fn main() { app_state.client.clone(), prompt_builder.clone(), app_state.languages.clone(), + false, cx, ); assistant_tools::init(app_state.client.http_client(), cx); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index c03a2b6004..77c02e3faa 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -4295,6 +4295,7 @@ mod tests { app_state.client.clone(), prompt_builder.clone(), app_state.languages.clone(), + false, cx, ); repl::init(app_state.fs.clone(), cx);