assistant2: Allow profiles to enable all context servers (#27847)

This PR adds a new `enable_all_context_servers` field to agent profiles
to allow them to enable all context servers without having to opt into
them individually.

The "Write" profile will now have all context servers enabled out of the
box.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-01 11:25:23 -04:00 committed by GitHub
parent ab31eb5d51
commit 12037dc2c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 68 additions and 29 deletions

View file

@ -9,6 +9,7 @@ pub struct AgentProfile {
/// The name of the profile.
pub name: SharedString,
pub tools: IndexMap<Arc<str>, bool>,
pub enable_all_context_servers: bool,
pub context_servers: IndexMap<Arc<str>, ContextServerPreset>,
}

View file

@ -352,6 +352,7 @@ impl AssistantSettingsContent {
AgentProfileContent {
name: profile.name.into(),
tools: profile.tools,
enable_all_context_servers: Some(profile.enable_all_context_servers),
context_servers: profile
.context_servers
.into_iter()
@ -485,6 +486,8 @@ impl Default for LanguageModelSelection {
pub struct AgentProfileContent {
pub name: Arc<str>,
pub tools: IndexMap<Arc<str>, bool>,
/// Whether all context servers are enabled by default.
pub enable_all_context_servers: Option<bool>,
#[serde(default)]
pub context_servers: IndexMap<Arc<str>, ContextServerPresetContent>,
}
@ -607,6 +610,9 @@ impl Settings for AssistantSettings {
AgentProfile {
name: profile.name.into(),
tools: profile.tools,
enable_all_context_servers: profile
.enable_all_context_servers
.unwrap_or_default(),
context_servers: profile
.context_servers
.into_iter()