Skip to content

Commit ff8fa05

Browse files
authored
agent: Remove new thread location setting (zed-industries#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
1 parent 6dd03c9 commit ff8fa05

8 files changed

Lines changed: 3 additions & 71 deletions

File tree

assets/settings/default.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,10 +1152,6 @@
11521152
"tools": {},
11531153
},
11541154
},
1155-
// Whether to start a new thread in the current local project or in a new Git worktree.
1156-
//
1157-
// Default: local_project
1158-
"new_thread_location": "local_project",
11591155
// Where to show notifications when the agent has either completed
11601156
// its response, or else needs confirmation before it can run a
11611157
// tool action.

crates/agent/src/tool_permissions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ mod tests {
597597
tool_permissions,
598598
show_turn_stats: false,
599599
show_merge_conflict_indicator: true,
600-
new_thread_location: Default::default(),
601600
sidebar_side: Default::default(),
602601
thinking_display: Default::default(),
603602
}

crates/agent_settings/src/agent_settings.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use project::DisableAiSettings;
1313
use schemars::JsonSchema;
1414
use serde::{Deserialize, Serialize};
1515
use settings::{
16-
DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection, NewThreadLocation,
16+
DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection,
1717
NotifyWhenAgentWaiting, PlaySoundWhenAgentDone, RegisterSetting, Settings, SettingsContent,
1818
SettingsStore, SidebarDockPosition, SidebarSide, ThinkingBlockDisplay, ToolPermissionMode,
1919
update_settings_file, update_settings_file_with_completion,
@@ -167,7 +167,6 @@ pub struct AgentSettings {
167167
pub show_turn_stats: bool,
168168
pub show_merge_conflict_indicator: bool,
169169
pub tool_permissions: ToolPermissions,
170-
pub new_thread_location: NewThreadLocation,
171170
}
172171

173172
impl AgentSettings {
@@ -671,7 +670,6 @@ impl Settings for AgentSettings {
671670
show_turn_stats: agent.show_turn_stats.unwrap(),
672671
show_merge_conflict_indicator: agent.show_merge_conflict_indicator.unwrap(),
673672
tool_permissions: compile_tool_permissions(agent.tool_permissions),
674-
new_thread_location: agent.new_thread_location.unwrap_or_default(),
675673
}
676674
}
677675
}

crates/agent_ui/src/agent_ui.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ mod tests {
713713
tool_permissions: Default::default(),
714714
show_turn_stats: false,
715715
show_merge_conflict_indicator: true,
716-
new_thread_location: Default::default(),
717716
sidebar_side: Default::default(),
718717
thinking_display: Default::default(),
719718
};

crates/agent_ui/src/conversation_view.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ use crate::DEFAULT_THREAD_TITLE;
4848
use crate::message_editor::SessionCapabilities;
4949
use rope::Point;
5050
use settings::{
51-
NewThreadLocation, NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide,
52-
ThinkingBlockDisplay,
51+
NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide, ThinkingBlockDisplay,
5352
};
5453
use std::path::Path;
5554
use std::sync::Arc;
@@ -862,10 +861,7 @@ impl ConversationView {
862861
SidebarSide::Left => "left",
863862
SidebarSide::Right => "right",
864863
};
865-
let thread_location = match AgentSettings::get_global(cx).new_thread_location {
866-
NewThreadLocation::LocalProject => "current_worktree",
867-
NewThreadLocation::NewWorktree => "new_worktree",
868-
};
864+
let thread_location = "current_worktree";
869865

870866
let load_task = cx.spawn_in(window, async move |this, cx| {
871867
let connection = match connect_result.await {

crates/settings_content/src/agent.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,6 @@ use crate::ExtendingVec;
99

1010
use crate::DockPosition;
1111

12-
/// Where new threads should start by default.
13-
#[derive(
14-
Clone,
15-
Copy,
16-
Debug,
17-
Default,
18-
PartialEq,
19-
Eq,
20-
Serialize,
21-
Deserialize,
22-
JsonSchema,
23-
MergeFrom,
24-
strum::VariantArray,
25-
strum::VariantNames,
26-
)]
27-
#[serde(rename_all = "snake_case")]
28-
pub enum NewThreadLocation {
29-
/// Start threads in the current project.
30-
#[default]
31-
LocalProject,
32-
/// Start threads in a new worktree.
33-
NewWorktree,
34-
}
35-
3612
/// Where to position the threads sidebar.
3713
#[derive(
3814
Clone,
@@ -161,10 +137,6 @@ pub struct AgentSettingsContent {
161137
///
162138
/// Default: write
163139
pub default_profile: Option<Arc<str>>,
164-
/// Where new threads should start by default.
165-
///
166-
/// Default: "local_project"
167-
pub new_thread_location: Option<NewThreadLocation>,
168140
/// The available agent profiles.
169141
pub profiles: Option<IndexMap<Arc<str>, AgentProfileContent>>,
170142
/// Where to show a popup notification when the agent is waiting for user input.
@@ -270,10 +242,6 @@ impl AgentSettingsContent {
270242
self.default_profile = Some(profile_id);
271243
}
272244

273-
pub fn set_new_thread_location(&mut self, value: NewThreadLocation) {
274-
self.new_thread_location = Some(value);
275-
}
276-
277245
pub fn add_favorite_model(&mut self, model: LanguageModelSelection) {
278246
// Note: this is intentional to not compare using `PartialEq`here.
279247
// Full equality would treat entries that differ just in thinking/effort/speed

crates/settings_ui/src/page_data.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7429,29 +7429,6 @@ fn ai_page(cx: &App) -> SettingsPage {
74297429
}),
74307430
];
74317431

7432-
items.push(SettingsPageItem::SettingItem(SettingItem {
7433-
title: "New Thread Location",
7434-
description: "Whether to start a new thread in the current local project or in a new Git worktree.",
7435-
field: Box::new(SettingField {
7436-
json_path: Some("agent.new_thread_location"),
7437-
pick: |settings_content| {
7438-
settings_content
7439-
.agent
7440-
.as_ref()?
7441-
.new_thread_location
7442-
.as_ref()
7443-
},
7444-
write: |settings_content, value, _| {
7445-
settings_content
7446-
.agent
7447-
.get_or_insert_default()
7448-
.new_thread_location = value;
7449-
},
7450-
}),
7451-
metadata: None,
7452-
files: USER,
7453-
}));
7454-
74557432
items.extend([
74567433
SettingsPageItem::SettingItem(SettingItem {
74577434
title: "Single File Review",

crates/settings_ui/src/settings_ui.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ fn init_renderers(cx: &mut App) {
530530
.add_basic_renderer::<settings::SteppingGranularity>(render_dropdown)
531531
.add_basic_renderer::<settings::NotifyWhenAgentWaiting>(render_dropdown)
532532
.add_basic_renderer::<settings::PlaySoundWhenAgentDone>(render_dropdown)
533-
.add_basic_renderer::<settings::NewThreadLocation>(render_dropdown)
534533
.add_basic_renderer::<settings::ThinkingBlockDisplay>(render_dropdown)
535534
.add_basic_renderer::<settings::ImageFileSizeUnit>(render_dropdown)
536535
.add_basic_renderer::<settings::StatusStyle>(render_dropdown)

0 commit comments

Comments
 (0)