From ff8fa053ff0d0c02aec95def5b796dbe5cd541e1 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Sun, 3 May 2026 21:30:04 +0200 Subject: [PATCH] agent: Remove new thread location setting (#55575) cc: @danilo-leal This setting is from when we had the git worktree picker in the agent panel, now that it is in the menu bar it doesn't make sense to keep it. We plan to add a similar feature in the future to handle the "new thread == new git worktree" workflow Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A --- assets/settings/default.json | 4 --- crates/agent/src/tool_permissions.rs | 1 - crates/agent_settings/src/agent_settings.rs | 4 +-- crates/agent_ui/src/agent_ui.rs | 1 - crates/agent_ui/src/conversation_view.rs | 8 ++---- crates/settings_content/src/agent.rs | 32 --------------------- crates/settings_ui/src/page_data.rs | 23 --------------- crates/settings_ui/src/settings_ui.rs | 1 - 8 files changed, 3 insertions(+), 71 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 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.rs index 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.rs index 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.rs index 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.rs index 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.rs index 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: write pub default_profile: Option>, - /// Where new threads should start by default. - /// - /// Default: "local_project" - pub new_thread_location: Option, /// The available agent profiles. pub profiles: Option, 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/speed diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs index 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.rs index 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::(render_dropdown) .add_basic_renderer::(render_dropdown) .add_basic_renderer::(render_dropdown) - .add_basic_renderer::(render_dropdown) .add_basic_renderer::(render_dropdown) .add_basic_renderer::(render_dropdown) .add_basic_renderer::(render_dropdown)