From 104f601413ca676f50e64b820ca50b0ae0159b53 Mon Sep 17 00:00:00 2001 From: Umesh Yadav <23421535+imumesh18@users.noreply.github.com> Date: Sat, 7 Jun 2025 15:02:01 +0530 Subject: [PATCH] language_models: Fix Copilot models not loading (#32288) Recently in this PR: https://github.com/zed-industries/zed/pull/32248 github copilot settings was introduced. This had missing settings update which was leading to github copilot models not getting fetched. This had missing subscription to update the settings inside the copilot language model provider. Which caused it not show models at all. cc @osiewicz Release Notes: - N/A --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> --- crates/language_models/src/provider/copilot_chat.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/language_models/src/provider/copilot_chat.rs b/crates/language_models/src/provider/copilot_chat.rs index c9ed413882b58dccc5b4ea807e381ce234c0e9bc..78c9e8581de51d7292be764931c53f04bd422049 100644 --- a/crates/language_models/src/provider/copilot_chat.rs +++ b/crates/language_models/src/provider/copilot_chat.rs @@ -68,6 +68,14 @@ impl CopilotChatLanguageModelProvider { State { _copilot_chat_subscription: copilot_chat_subscription, _settings_subscription: cx.observe_global::(|_, cx| { + if let Some(copilot_chat) = CopilotChat::global(cx) { + let settings = AllLanguageModelSettings::get_global(cx) + .copilot_chat + .clone(); + copilot_chat.update(cx, |chat, cx| { + chat.set_settings(settings, cx); + }); + } cx.notify(); }), }