From c627543b461d51aeee4feb7a4d8ec3bcf934b763 Mon Sep 17 00:00:00 2001 From: Umesh Yadav <23421535+imumesh18@users.noreply.github.com> Date: Thu, 25 Sep 2025 18:11:49 +0530 Subject: [PATCH] assistant_context: Fix `thread_summary_model` not getting used in Text Threads (#38859) Closes https://github.com/zed-industries/zed/issues/37472 Release Notes: - Fixed an issue in Text Threads where it was using `default_model` even in case `thread_summary_model` was set. --------- Signed-off-by: Umesh Yadav --- crates/assistant_context/src/assistant_context.rs | 2 +- .../src/assistant_context_tests.rs | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/assistant_context/src/assistant_context.rs b/crates/assistant_context/src/assistant_context.rs index 23aeabbc8929e6a3874c2fbbf74b8f9729860481..6c06cc2c8ec7f845b1e6d49631a1bea6755a62d0 100644 --- a/crates/assistant_context/src/assistant_context.rs +++ b/crates/assistant_context/src/assistant_context.rs @@ -2669,7 +2669,7 @@ impl AssistantContext { } pub fn summarize(&mut self, mut replace_old: bool, cx: &mut Context) { - let Some(model) = LanguageModelRegistry::read_global(cx).default_model() else { + let Some(model) = LanguageModelRegistry::read_global(cx).thread_summary_model() else { return; }; diff --git a/crates/assistant_context/src/assistant_context_tests.rs b/crates/assistant_context/src/assistant_context_tests.rs index 8b182685cfeb4e3ae1b9df8c532b8f0c5ad91235..413e32dfcb14273920e9ae4110e5905bdbae5956 100644 --- a/crates/assistant_context/src/assistant_context_tests.rs +++ b/crates/assistant_context/src/assistant_context_tests.rs @@ -1329,13 +1329,12 @@ fn setup_context_editor_with_fake_model( cx.update(|cx| { init_test(cx); LanguageModelRegistry::global(cx).update(cx, |registry, cx| { - registry.set_default_model( - Some(ConfiguredModel { - provider: fake_provider.clone(), - model: fake_model.clone(), - }), - cx, - ) + let configured_model = ConfiguredModel { + provider: fake_provider.clone(), + model: fake_model.clone(), + }; + registry.set_default_model(Some(configured_model.clone()), cx); + registry.set_thread_summary_model(Some(configured_model), cx); }) });