From 30a441b7149d38d1cdf0a070c360b165b191c1f5 Mon Sep 17 00:00:00 2001 From: Umesh Yadav <23421535+imumesh18@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:32:33 +0530 Subject: [PATCH] agent_ui: Fix disabled context servers not showing in agent setting (#33856) Previously if I set enabled: false for one the context servers in settings.json it will not show up in the settings in agent panel when I start zed. But if I enabled it from settings it properly showed up. We were filtering the configuration to only get the enabled context servers from settings.json. This PR adds fetching all of them. Release Notes: - agent: Show context servers which are disabled in settings in agent panel settings. --- crates/agent_ui/src/agent_configuration.rs | 2 +- crates/project/src/context_server_store.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/agent_configuration.rs b/crates/agent_ui/src/agent_configuration.rs index d91aa5fb2200629703f2f789f293686eb4c3ad73..8bfdd507611112b2930fd07270667050796533e3 100644 --- a/crates/agent_ui/src/agent_configuration.rs +++ b/crates/agent_ui/src/agent_configuration.rs @@ -436,7 +436,7 @@ impl AgentConfiguration { window: &mut Window, cx: &mut Context, ) -> impl IntoElement { - let context_server_ids = self.context_server_store.read(cx).all_server_ids().clone(); + let context_server_ids = self.context_server_store.read(cx).configured_server_ids(); v_flex() .p(DynamicSpacing::Base16.rems(cx)) diff --git a/crates/project/src/context_server_store.rs b/crates/project/src/context_server_store.rs index d2541e1b31fe6a798edc92bb070a17b631f61f98..fd31e638d4bf7774af83d430dca232d1ade74f01 100644 --- a/crates/project/src/context_server_store.rs +++ b/crates/project/src/context_server_store.rs @@ -171,6 +171,15 @@ impl ContextServerStore { ) } + /// Returns all configured context server ids, regardless of enabled state. + pub fn configured_server_ids(&self) -> Vec { + self.context_server_settings + .keys() + .cloned() + .map(ContextServerId) + .collect() + } + #[cfg(any(test, feature = "test-support"))] pub fn test( registry: Entity,