From 7e694d1bcfc7fd2d008ecfb146a795a0983ab33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Tue, 25 Jun 2024 23:58:13 +0800 Subject: [PATCH] Fix an issue where provider settings were lost when switching between Ollama models (#13402) Closes #13399. Release Notes: - Fixed an issue where provider settings were lost when switching between Ollama models ([#13399](https://github.com/zed-industries/zed/issues/13399)). --- crates/assistant/src/assistant_settings.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/assistant/src/assistant_settings.rs b/crates/assistant/src/assistant_settings.rs index 07d87961ec..95b3927ca6 100644 --- a/crates/assistant/src/assistant_settings.rs +++ b/crates/assistant/src/assistant_settings.rs @@ -326,6 +326,14 @@ impl AssistantSettingsContent { *model = Some(new_model); } } + Some(AssistantProviderContent::Ollama { + default_model: model, + .. + }) => { + if let LanguageModel::Ollama(new_model) = new_model { + *model = Some(new_model); + } + } provider => match new_model { LanguageModel::Cloud(model) => { *provider = Some(AssistantProviderContent::ZedDotDev {