Rename assistant_settings to agent_settings (#31513)

This PR renames the `assistant_settings` crate to `agent_settings`, as
well a number of constructs within it.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-27 11:16:55 -04:00 committed by GitHub
parent 61a40e293d
commit 8faeb34367
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 418 additions and 451 deletions

View file

@ -17,9 +17,9 @@ default = []
test-support = ["multi_buffer/test-support"]
[dependencies]
agent_settings.workspace = true
anyhow.workspace = true
askpass.workspace = true
assistant_settings.workspace = true
buffer_diff.workspace = true
chrono.workspace = true
collections.workspace = true
@ -56,9 +56,9 @@ time.workspace = true
time_format.workspace = true
ui.workspace = true
util.workspace = true
workspace-hack.workspace = true
workspace.workspace = true
zed_actions.workspace = true
workspace-hack.workspace = true
[target.'cfg(windows)'.dependencies]
windows.workspace = true

View file

@ -9,9 +9,9 @@ use crate::{branch_picker, picker_prompt, render_remote_button};
use crate::{
git_panel_settings::GitPanelSettings, git_status_icon, repository_selector::RepositorySelector,
};
use agent_settings::AgentSettings;
use anyhow::Context as _;
use askpass::AskPassDelegate;
use assistant_settings::AssistantSettings;
use db::kvp::KEY_VALUE_STORE;
use editor::{
@ -481,10 +481,10 @@ impl GitPanel {
hide_task: None,
};
let mut assistant_enabled = AssistantSettings::get_global(cx).enabled;
let mut assistant_enabled = AgentSettings::get_global(cx).enabled;
let _settings_subscription = cx.observe_global::<SettingsStore>(move |_, cx| {
if assistant_enabled != AssistantSettings::get_global(cx).enabled {
assistant_enabled = AssistantSettings::get_global(cx).enabled;
if assistant_enabled != AgentSettings::get_global(cx).enabled {
assistant_enabled = AgentSettings::get_global(cx).enabled;
cx.notify();
}
});
@ -1747,7 +1747,7 @@ impl GitPanel {
}
});
let temperature = AssistantSettings::temperature_for_model(&model, cx);
let temperature = AgentSettings::temperature_for_model(&model, cx);
self.generate_commit_message_task = Some(cx.spawn(async move |this, cx| {
async move {
@ -4061,7 +4061,7 @@ impl GitPanel {
}
fn current_language_model(cx: &Context<'_, GitPanel>) -> Option<Arc<dyn LanguageModel>> {
assistant_settings::AssistantSettings::get_global(cx)
agent_settings::AgentSettings::get_global(cx)
.enabled
.then(|| {
let ConfiguredModel { provider, model } =
@ -4784,7 +4784,7 @@ mod tests {
cx.update(|cx| {
let settings_store = SettingsStore::test(cx);
cx.set_global(settings_store);
AssistantSettings::register(cx);
AgentSettings::register(cx);
WorktreeSettings::register(cx);
workspace::init_settings(cx);
theme::init(LoadThemes::JustBase, cx);