From 19429026c1a20da8947ad1a7adca8d73c7f0ffce Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Tue, 21 Apr 2026 18:43:44 +0200 Subject: [PATCH] Remove `AgentV2FeatureFlag` (#54430) 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) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- Cargo.lock | 1 - crates/agent_ui/src/agent_panel.rs | 7 +-- crates/agent_ui/src/agent_ui.rs | 39 ++------------- crates/feature_flags/src/flags.rs | 12 ----- crates/settings_ui/src/page_data.rs | 65 +++++++++++-------------- crates/workspace/Cargo.toml | 1 - crates/workspace/src/multi_workspace.rs | 4 +- crates/zed/src/zed/open_listener.rs | 6 --- 8 files changed, 33 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20695db73fb83c9fc22c0b9338968beecee0086f..5b9676d92f98a61c6b24ac75128383e08c739592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21778,7 +21778,6 @@ dependencies = [ "postage", "pretty_assertions", "project", - "release_channel", "remote", "schemars", "serde", diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 147d9755e0858dda09bf9f4bd5bd616bd83135de..33788d60a99f6f0478568179e38ae3cc4e0a964d 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -67,7 +67,6 @@ use language::LanguageRegistry; use language_model::LanguageModelRegistry; use project::{Project, ProjectPath, Worktree}; use prompt_store::{PromptStore, UserPromptId}; -use release_channel::ReleaseChannel; use rules_library::{RulesLibrary, open_rules_library}; use settings::TerminalDockPosition; use settings::{Settings, update_settings_file}; @@ -89,9 +88,6 @@ const AGENT_PANEL_KEY: &str = "agent_panel"; const MIN_PANEL_WIDTH: Pixels = px(300.); const LAST_USED_AGENT_KEY: &str = "agent_panel__last_used_external_agent"; -fn agent_v2_enabled(cx: &App) -> bool { - !matches!(ReleaseChannel::try_global(cx), Some(ReleaseChannel::Stable)) -} /// Maximum number of idle threads kept in the agent panel's retained list. /// Set as a GPUI global to override; otherwise defaults to 5. pub struct MaxIdleRetainedThreads(pub usize); @@ -3213,7 +3209,6 @@ impl AgentPanel { selected_agent.into_any_element() }; - let agent_v2_enabled = agent_v2_enabled(cx); let is_empty_state = !self.active_thread_has_messages(cx); let is_in_history_or_config = self.is_overlay_open(); @@ -3235,7 +3230,7 @@ impl AgentPanel { })) }; - let use_v2_empty_toolbar = agent_v2_enabled && is_empty_state && !is_in_history_or_config; + let use_v2_empty_toolbar = is_empty_state && !is_in_history_or_config; let max_content_width = AgentSettings::get_global(cx).max_content_width; diff --git a/crates/agent_ui/src/agent_ui.rs b/crates/agent_ui/src/agent_ui.rs index fa9fa244ef887930906ab48ef49ee69f3573ed45..4786800644d6cabc8b33767d39bd751c016e54c9 100644 --- a/crates/agent_ui/src/agent_ui.rs +++ b/crates/agent_ui/src/agent_ui.rs @@ -43,7 +43,7 @@ use agent_settings::{AgentProfileId, AgentSettings}; use command_palette_hooks::CommandPaletteFilter; use feature_flags::FeatureFlagAppExt as _; use fs::Fs; -use gpui::{Action, App, Context, Entity, SharedString, UpdateGlobal as _, Window, actions}; +use gpui::{Action, App, Context, Entity, SharedString, Window, actions}; use language::{ LanguageRegistry, language_settings::{AllLanguageSettings, EditPredictionProvider}, @@ -53,10 +53,9 @@ use language_model::{ }; use project::{AgentId, DisableAiSettings}; use prompt_store::PromptBuilder; -use release_channel::ReleaseChannel; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use settings::{DockPosition, DockSide, LanguageModelSelection, Settings as _, SettingsStore}; +use settings::{LanguageModelSelection, Settings as _, SettingsStore}; use std::any::TypeId; use workspace::Workspace; @@ -500,34 +499,7 @@ pub fn init( }) .detach(); - let agent_v2_enabled = agent_v2_enabled(cx); - if agent_v2_enabled { - maybe_backfill_editor_layout(fs, is_new_install, cx); - } - - SettingsStore::update_global(cx, |store, cx| { - store.update_default_settings(cx, |defaults| { - if agent_v2_enabled { - defaults.agent.get_or_insert_default().dock = Some(DockPosition::Left); - defaults.project_panel.get_or_insert_default().dock = Some(DockSide::Right); - defaults.outline_panel.get_or_insert_default().dock = Some(DockSide::Right); - defaults.collaboration_panel.get_or_insert_default().dock = - Some(DockPosition::Right); - defaults.git_panel.get_or_insert_default().dock = Some(DockPosition::Right); - } else { - defaults.agent.get_or_insert_default().dock = Some(DockPosition::Right); - defaults.project_panel.get_or_insert_default().dock = Some(DockSide::Left); - defaults.outline_panel.get_or_insert_default().dock = Some(DockSide::Left); - defaults.collaboration_panel.get_or_insert_default().dock = - Some(DockPosition::Left); - defaults.git_panel.get_or_insert_default().dock = Some(DockPosition::Left); - } - }); - }); -} - -fn agent_v2_enabled(cx: &App) -> bool { - !matches!(ReleaseChannel::try_global(cx), Some(ReleaseChannel::Stable)) + maybe_backfill_editor_layout(fs, is_new_install, cx); } fn maybe_backfill_editor_layout(fs: Arc, is_new_install: bool, cx: &mut App) { @@ -555,7 +527,6 @@ fn maybe_backfill_editor_layout(fs: Arc, is_new_install: bool, cx: &mut fn update_command_palette_filter(cx: &mut App) { let disable_ai = DisableAiSettings::get_global(cx).disable_ai; let agent_enabled = AgentSettings::get_global(cx).enabled; - let agent_v2_enabled = agent_v2_enabled(cx); let edit_prediction_provider = AllLanguageSettings::get_global(cx) .edit_predictions @@ -623,12 +594,8 @@ fn update_command_palette_filter(cx: &mut App) { filter.show_namespace("zed_predict_onboarding"); filter.show_action_types(&[TypeId::of::()]); - } - if agent_v2_enabled { filter.show_namespace("multi_workspace"); - } else { - filter.hide_namespace("multi_workspace"); } }); } diff --git a/crates/feature_flags/src/flags.rs b/crates/feature_flags/src/flags.rs index 1665e6ffb6c0685370beab589c1bb88f714d70d0..aae8137a0a6e9d5273f1fca88ec4c81bae7f7e9b 100644 --- a/crates/feature_flags/src/flags.rs +++ b/crates/feature_flags/src/flags.rs @@ -16,18 +16,6 @@ impl FeatureFlag for PanicFeatureFlag { } register_feature_flag!(PanicFeatureFlag); -pub struct AgentV2FeatureFlag; - -impl FeatureFlag for AgentV2FeatureFlag { - const NAME: &'static str = "agent-v2"; - type Value = PresenceFlag; - - fn enabled_for_staff() -> bool { - true - } -} -register_feature_flag!(AgentV2FeatureFlag); - /// A feature flag for granting access to beta ACP features. /// /// We reuse this feature flag for new betas, so don't delete it if it is not currently in use. diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs index c502c1058f08bba5259faeccb424c448607367b4..30d60febe5adf71efef30248ee8404832451fc36 100644 --- a/crates/settings_ui/src/page_data.rs +++ b/crates/settings_ui/src/page_data.rs @@ -1,6 +1,5 @@ use gpui::{Action as _, App}; use itertools::Itertools as _; -use release_channel::ReleaseChannel; use settings::{ AudioInputDeviceName, AudioOutputDeviceName, LanguageSettingsContent, SemanticTokens, SettingsContent, @@ -106,8 +105,8 @@ fn developer_page() -> SettingsPage { } fn general_page(cx: &App) -> SettingsPage { - fn general_settings_section(cx: &App) -> Vec { - let mut items = vec![ + fn general_settings_section(_cx: &App) -> Vec { + vec![ SettingsPageItem::SectionHeader("General Settings"), SettingsPageItem::SettingItem(SettingItem { files: PROJECT, @@ -225,11 +224,7 @@ fn general_page(cx: &App) -> SettingsPage { metadata: None, files: USER, }), - ]; - - use feature_flags::FeatureFlagAppExt; - if cx.has_flag::() { - items.push(SettingsPageItem::SettingItem(SettingItem { + SettingsPageItem::SettingItem(SettingItem { title: "CLI Default Open Behavior", description: "How `zed ` opens directories when no flag is specified.", field: Box::new(SettingField { @@ -249,10 +244,8 @@ fn general_page(cx: &App) -> SettingsPage { ..Default::default() })), files: USER, - })); - } - - items + }), + ] } fn security_section() -> [SettingsPageItem; 2] { [ @@ -7373,7 +7366,7 @@ fn ai_page(cx: &App) -> SettingsPage { ] } - fn agent_configuration_section(cx: &App) -> Box<[SettingsPageItem]> { + fn agent_configuration_section(_cx: &App) -> Box<[SettingsPageItem]> { let mut items = vec![ SettingsPageItem::SectionHeader("Agent Configuration"), SettingsPageItem::SubPageLink(SubPageLink { @@ -7387,30 +7380,28 @@ fn ai_page(cx: &App) -> SettingsPage { }), ]; - if !matches!(ReleaseChannel::try_global(cx), Some(ReleaseChannel::Stable)) { - 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.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 { diff --git a/crates/workspace/Cargo.toml b/crates/workspace/Cargo.toml index 2014e7ad6f61bad8d2939c0232af92755eccea7f..00cd8ebbed433322ce96b01714c2fa1244d483d7 100644 --- a/crates/workspace/Cargo.toml +++ b/crates/workspace/Cargo.toml @@ -50,7 +50,6 @@ node_runtime.workspace = true parking_lot.workspace = true postage.workspace = true project.workspace = true -release_channel.workspace = true remote.workspace = true schemars.workspace = true serde.workspace = true diff --git a/crates/workspace/src/multi_workspace.rs b/crates/workspace/src/multi_workspace.rs index 0752dd2e3f3e6d9a01656ad72b6ba5adc67edcc6..a70104818de544e0bf48274b30be64e4a29dc577 100644 --- a/crates/workspace/src/multi_workspace.rs +++ b/crates/workspace/src/multi_workspace.rs @@ -8,7 +8,6 @@ use gpui::{ }; pub use project::ProjectGroupKey; use project::{DisableAiSettings, Project}; -use release_channel::ReleaseChannel; use remote::RemoteConnectionOptions; use settings::Settings; pub use settings::SidebarSide; @@ -397,8 +396,7 @@ impl MultiWorkspace { } pub fn multi_workspace_enabled(&self, cx: &App) -> bool { - !matches!(ReleaseChannel::try_global(cx), Some(ReleaseChannel::Stable)) - && !DisableAiSettings::get_global(cx).disable_ai + !DisableAiSettings::get_global(cx).disable_ai } pub fn toggle_sidebar(&mut self, window: &mut Window, cx: &mut Context) { diff --git a/crates/zed/src/zed/open_listener.rs b/crates/zed/src/zed/open_listener.rs index 065bb7595d8e67ede90bf12caef5f3a439a4ba5c..6faf0d3fe6835d078bef51442d85ba0591f389d6 100644 --- a/crates/zed/src/zed/open_listener.rs +++ b/crates/zed/src/zed/open_listener.rs @@ -12,7 +12,6 @@ use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender}; use futures::channel::{mpsc, oneshot}; use futures::future; -use feature_flags::FeatureFlagAppExt as _; use futures::{FutureExt, StreamExt}; use git_ui::{file_diff_view::FileDiffView, multi_diff_view::MultiDiffView}; use gpui::{App, AsyncApp, Global, WindowHandle}; @@ -558,11 +557,6 @@ async fn resolve_open_behavior( requests: &mut mpsc::UnboundedReceiver, cx: &mut AsyncApp, ) -> Option { - let cli_prompt_enabled = cx.update(|cx| cx.has_flag::()); - if !cli_prompt_enabled { - return Some(settings::CliDefaultOpenBehavior::NewWindow); - } - let has_existing_windows = cx.update(|cx| { cx.windows() .iter()