diff --git a/crates/agent/src/assistant_configuration/tool_picker.rs b/crates/agent/src/assistant_configuration/tool_picker.rs index db52fa8b57..2c48792446 100644 --- a/crates/agent/src/assistant_configuration/tool_picker.rs +++ b/crates/agent/src/assistant_configuration/tool_picker.rs @@ -272,7 +272,7 @@ impl PickerDelegate for ToolPickerDelegate { .get(id.as_ref()) .and_then(|preset| preset.tools.get(&tool.name)) .copied() - .unwrap_or(false), + .unwrap_or(self.profile.enable_all_context_servers), }; Some( diff --git a/crates/agent/src/thread_store.rs b/crates/agent/src/thread_store.rs index a907e1d440..6f7ee0b7c9 100644 --- a/crates/agent/src/thread_store.rs +++ b/crates/agent/src/thread_store.rs @@ -494,6 +494,22 @@ impl ThreadStore { ); }); } + // Enable all the tools from all context servers, but disable the ones that are explicitly disabled + for (context_server_id, preset) in &profile.context_servers { + self.tools.update(cx, |tools, cx| { + tools.disable( + ToolSource::ContextServer { + id: context_server_id.clone().into(), + }, + &preset + .tools + .iter() + .filter_map(|(tool, enabled)| (!enabled).then(|| tool.clone())) + .collect::>(), + cx, + ) + }) + } } else { for (context_server_id, preset) in &profile.context_servers { self.tools.update(cx, |tools, cx| {