assistant2: Define built-in agent profiles in the default settings (#27251)

This PR moves the definitions of the built-in agent profiles into the
default `settings.json`.

It also changes the behavior of how this setting is treated when merging
settings such that the set of profiles will be merged. This is so users
don't clobber the built-in profiles when adding profiles of their own.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-21 11:11:45 -04:00 committed by GitHub
parent 4e93e38b0a
commit f119550838
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 47 additions and 71 deletions

View file

@ -32,21 +32,8 @@ impl ToolSelector {
fn refresh_profiles(&mut self, cx: &mut Context<Self>) {
let settings = AssistantSettings::get_global(cx);
let mut profiles = BTreeMap::from_iter(settings.profiles.clone());
const READ_ONLY_ID: &str = "read-only";
let read_only = AgentProfile::read_only();
if !profiles.contains_key(READ_ONLY_ID) {
profiles.insert(READ_ONLY_ID.into(), read_only);
}
const CODE_WRITER_ID: &str = "code-writer";
let code_writer = AgentProfile::code_writer();
if !profiles.contains_key(CODE_WRITER_ID) {
profiles.insert(CODE_WRITER_ID.into(), code_writer);
}
self.profiles = profiles;
self.profiles = BTreeMap::from_iter(settings.profiles.clone());
}
fn build_context_menu(