From 40c417f9c3a3e4b4d0bb32e33054ce4ebd02a245 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 2 Oct 2025 12:16:51 -0400 Subject: [PATCH] Subscribe to CodexAcpFeatureFlag (#39380) Otherwise Codex doesn't work on first launch. Release Notes: - N/A --- crates/project/src/agent_server_store.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/project/src/agent_server_store.rs b/crates/project/src/agent_server_store.rs index 7a34c34f759d017b16b644a4f38efca7524f2451..53e4fa06fa93df95d271dd119a1b217cf21b0a48 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>, + _feature_flag_subscription: Option, } pub struct AgentServersUpdated; @@ -249,6 +251,13 @@ impl AgentServerStore { let subscription = cx.observe_global::(|this, cx| { this.agent_servers_settings_changed(cx); }); + let this_handle = cx.weak_entity(); + let feature_flags_subscription = + cx.observe_flag::(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, } }