Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Subscribe to CodexAcpFeatureFlag (#39380)
Richard Feldman40c417f9c3a3
diff --git a/crates/project/src/agent_server_store.rs b/crates/project/src/agent_server_store.rsindex 7a34c34f759..53e4fa06fa9 100644--- a/crates/project/src/agent_server_store.rs+++ b/crates/project/src/agent_server_store.rs@@ -10,6 +10,7 @@ use std::{use anyhow::{Context as _, Result, bail};use client::Client;use collections::HashMap;+use feature_flags::FeatureFlagAppExt as _;use fs::{Fs, RemoveOptions, RenameOptions};use futures::StreamExt as _;use gpui::{@@ -124,6 +125,7 @@ enum AgentServerStoreState {pub struct AgentServerStore {state: AgentServerStoreState,external_agents: HashMap<ExternalAgentServerName, Box<dyn ExternalAgentServer>>,+ _feature_flag_subscription: Option<gpui::Subscription>,}pub struct AgentServersUpdated;@@ -249,6 +251,13 @@ impl AgentServerStore {let subscription = cx.observe_global::<SettingsStore>(|this, cx| {this.agent_servers_settings_changed(cx);});+ let this_handle = cx.weak_entity();+ let feature_flags_subscription =+ cx.observe_flag::<feature_flags::CodexAcpFeatureFlag, _>(move |_enabled, cx| {+ let _ = this_handle.update(cx, |this, cx| {+ this.agent_servers_settings_changed(cx);+ });+ });let mut this = Self {state: AgentServerStoreState::Local {node_runtime,@@ -259,6 +268,7 @@ impl AgentServerStore {_subscriptions: [subscription],},external_agents: Default::default(),+ _feature_flag_subscription: Some(feature_flags_subscription),};this.agent_servers_settings_changed(cx);this@@ -303,6 +313,7 @@ impl AgentServerStore {upstream_client,},external_agents,+ _feature_flag_subscription: None,}}@@ -310,6 +321,7 @@ impl AgentServerStore {Self {state: AgentServerStoreState::Collab,external_agents: Default::default(),+ _feature_flag_subscription: None,}}