Skip to content

Commit 30a441b

Browse files
authored
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.
1 parent 83562fc commit 30a441b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

crates/agent_ui/src/agent_configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl AgentConfiguration {
436436
window: &mut Window,
437437
cx: &mut Context<Self>,
438438
) -> impl IntoElement {
439-
let context_server_ids = self.context_server_store.read(cx).all_server_ids().clone();
439+
let context_server_ids = self.context_server_store.read(cx).configured_server_ids();
440440

441441
v_flex()
442442
.p(DynamicSpacing::Base16.rems(cx))

crates/project/src/context_server_store.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ impl ContextServerStore {
171171
)
172172
}
173173

174+
/// Returns all configured context server ids, regardless of enabled state.
175+
pub fn configured_server_ids(&self) -> Vec<ContextServerId> {
176+
self.context_server_settings
177+
.keys()
178+
.cloned()
179+
.map(ContextServerId)
180+
.collect()
181+
}
182+
174183
#[cfg(any(test, feature = "test-support"))]
175184
pub fn test(
176185
registry: Entity<ContextServerDescriptorRegistry>,

0 commit comments

Comments
 (0)