Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent: Remove new thread location setting (#55575)
Anthony Eidff8fa053ff0d
diff --git a/assets/settings/default.json b/assets/settings/default.jsonindex d2bec722662..54b9070da2b 100644--- a/assets/settings/default.json+++ b/assets/settings/default.json@@ -1152,10 +1152,6 @@"tools": {},},},- // Whether to start a new thread in the current local project or in a new Git worktree.- //- // Default: local_project- "new_thread_location": "local_project",// Where to show notifications when the agent has either completed// its response, or else needs confirmation before it can run a// tool action.diff --git a/crates/agent/src/tool_permissions.rs b/crates/agent/src/tool_permissions.rsindex 65cbcfb2c60..2d3638265f7 100644--- a/crates/agent/src/tool_permissions.rs+++ b/crates/agent/src/tool_permissions.rs@@ -597,7 +597,6 @@ mod tests {tool_permissions,show_turn_stats: false,show_merge_conflict_indicator: true,- new_thread_location: Default::default(),sidebar_side: Default::default(),thinking_display: Default::default(),}diff --git a/crates/agent_settings/src/agent_settings.rs b/crates/agent_settings/src/agent_settings.rsindex 5dd939c4ad1..37648997c3b 100644--- a/crates/agent_settings/src/agent_settings.rs+++ b/crates/agent_settings/src/agent_settings.rs@@ -13,7 +13,7 @@ use project::DisableAiSettings;use schemars::JsonSchema;use serde::{Deserialize, Serialize};use settings::{- DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection, NewThreadLocation,+ DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection,NotifyWhenAgentWaiting, PlaySoundWhenAgentDone, RegisterSetting, Settings, SettingsContent,SettingsStore, SidebarDockPosition, SidebarSide, ThinkingBlockDisplay, ToolPermissionMode,update_settings_file, update_settings_file_with_completion,@@ -167,7 +167,6 @@ pub struct AgentSettings {pub show_turn_stats: bool,pub show_merge_conflict_indicator: bool,pub tool_permissions: ToolPermissions,- pub new_thread_location: NewThreadLocation,}impl AgentSettings {@@ -671,7 +670,6 @@ impl Settings for AgentSettings {show_turn_stats: agent.show_turn_stats.unwrap(),show_merge_conflict_indicator: agent.show_merge_conflict_indicator.unwrap(),tool_permissions: compile_tool_permissions(agent.tool_permissions),- new_thread_location: agent.new_thread_location.unwrap_or_default(),}}}diff --git a/crates/agent_ui/src/agent_ui.rs b/crates/agent_ui/src/agent_ui.rsindex 449194a7380..226471fc024 100644--- a/crates/agent_ui/src/agent_ui.rs+++ b/crates/agent_ui/src/agent_ui.rs@@ -713,7 +713,6 @@ mod tests {tool_permissions: Default::default(),show_turn_stats: false,show_merge_conflict_indicator: true,- new_thread_location: Default::default(),sidebar_side: Default::default(),thinking_display: Default::default(),};diff --git a/crates/agent_ui/src/conversation_view.rs b/crates/agent_ui/src/conversation_view.rsindex c6ce183863b..c1a975939f6 100644--- a/crates/agent_ui/src/conversation_view.rs+++ b/crates/agent_ui/src/conversation_view.rs@@ -48,8 +48,7 @@ use crate::DEFAULT_THREAD_TITLE;use crate::message_editor::SessionCapabilities;use rope::Point;use settings::{- NewThreadLocation, NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide,- ThinkingBlockDisplay,+ NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide, ThinkingBlockDisplay,};use std::path::Path;use std::sync::Arc;@@ -862,10 +861,7 @@ impl ConversationView {SidebarSide::Left => "left",SidebarSide::Right => "right",};- let thread_location = match AgentSettings::get_global(cx).new_thread_location {- NewThreadLocation::LocalProject => "current_worktree",- NewThreadLocation::NewWorktree => "new_worktree",- };+ let thread_location = "current_worktree";let load_task = cx.spawn_in(window, async move |this, cx| {let connection = match connect_result.await {diff --git a/crates/settings_content/src/agent.rs b/crates/settings_content/src/agent.rsindex 2cdeb1e94e1..26b563e0842 100644--- a/crates/settings_content/src/agent.rs+++ b/crates/settings_content/src/agent.rs@@ -9,30 +9,6 @@ use crate::ExtendingVec;use crate::DockPosition;-/// Where new threads should start by default.-#[derive(- Clone,- Copy,- Debug,- Default,- PartialEq,- Eq,- Serialize,- Deserialize,- JsonSchema,- MergeFrom,- strum::VariantArray,- strum::VariantNames,-)]-#[serde(rename_all = "snake_case")]-pub enum NewThreadLocation {- /// Start threads in the current project.- #[default]- LocalProject,- /// Start threads in a new worktree.- NewWorktree,-}-/// Where to position the threads sidebar.#[derive(Clone,@@ -161,10 +137,6 @@ pub struct AgentSettingsContent {////// Default: writepub default_profile: Option<Arc<str>>,- /// Where new threads should start by default.- ///- /// Default: "local_project"- pub new_thread_location: Option<NewThreadLocation>,/// The available agent profiles.pub profiles: Option<IndexMap<Arc<str>, AgentProfileContent>>,/// Where to show a popup notification when the agent is waiting for user input.@@ -270,10 +242,6 @@ impl AgentSettingsContent {self.default_profile = Some(profile_id);}- pub fn set_new_thread_location(&mut self, value: NewThreadLocation) {- self.new_thread_location = Some(value);- }-pub fn add_favorite_model(&mut self, model: LanguageModelSelection) {// Note: this is intentional to not compare using `PartialEq`here.// Full equality would treat entries that differ just in thinking/effort/speeddiff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rsindex 99dd77b84ae..112aa5f5716 100644--- a/crates/settings_ui/src/page_data.rs+++ b/crates/settings_ui/src/page_data.rs@@ -7429,29 +7429,6 @@ fn ai_page(cx: &App) -> SettingsPage {}),];- items.push(SettingsPageItem::SettingItem(SettingItem {- title: "New Thread Location",- description: "Whether to start a new thread in the current local project or in a new Git worktree.",- field: Box::new(SettingField {- json_path: Some("agent.new_thread_location"),- pick: |settings_content| {- settings_content- .agent- .as_ref()?- .new_thread_location- .as_ref()- },- write: |settings_content, value, _| {- settings_content- .agent- .get_or_insert_default()- .new_thread_location = value;- },- }),- metadata: None,- files: USER,- }));-items.extend([SettingsPageItem::SettingItem(SettingItem {title: "Single File Review",diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rsindex a718e1277ef..d22687b0b75 100644--- a/crates/settings_ui/src/settings_ui.rs+++ b/crates/settings_ui/src/settings_ui.rs@@ -530,7 +530,6 @@ fn init_renderers(cx: &mut App) {.add_basic_renderer::<settings::SteppingGranularity>(render_dropdown).add_basic_renderer::<settings::NotifyWhenAgentWaiting>(render_dropdown).add_basic_renderer::<settings::PlaySoundWhenAgentDone>(render_dropdown)- .add_basic_renderer::<settings::NewThreadLocation>(render_dropdown).add_basic_renderer::<settings::ThinkingBlockDisplay>(render_dropdown).add_basic_renderer::<settings::ImageFileSizeUnit>(render_dropdown).add_basic_renderer::<settings::StatusStyle>(render_dropdown)