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.
This commit is contained in:
Umesh Yadav 2025-07-07 15:32:33 +05:30 committed by GitHub
parent 83562fca77
commit 30a441b714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -436,7 +436,7 @@ impl AgentConfiguration {
window: &mut Window,
cx: &mut Context<Self>,
) -> 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))

View file

@ -171,6 +171,15 @@ impl ContextServerStore {
)
}
/// Returns all configured context server ids, regardless of enabled state.
pub fn configured_server_ids(&self) -> Vec<ContextServerId> {
self.context_server_settings
.keys()
.cloned()
.map(ContextServerId)
.collect()
}
#[cfg(any(test, feature = "test-support"))]
pub fn test(
registry: Entity<ContextServerDescriptorRegistry>,