Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
feature_flags: Rename `cloud-thinking-toggle` feature flag (#48598)
Marshall Bowers3d57951b417b
diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rsindex 1a3deabda6a..d9bd7b28ad1 100644--- a/crates/agent_ui/src/acp/thread_view.rs+++ b/crates/agent_ui/src/acp/thread_view.rs@@ -21,7 +21,7 @@ use editor::{Editor, EditorEvent, EditorMode, MultiBuffer, PathKey, SelectionEffects, SizingBehavior,};use feature_flags::{- AgentSharingFeatureFlag, AgentV2FeatureFlag, CloudThinkingToggleFeatureFlag,+ AgentSharingFeatureFlag, AgentV2FeatureFlag, CloudThinkingEffortFeatureFlag,FeatureFlagAppExt as _,};use file_icons::FileIcons;diff --git a/crates/agent_ui/src/acp/thread_view/active_thread.rs b/crates/agent_ui/src/acp/thread_view/active_thread.rsindex 9fca0cfe1fb..de3b9038c71 100644--- a/crates/agent_ui/src/acp/thread_view/active_thread.rs+++ b/crates/agent_ui/src/acp/thread_view/active_thread.rs@@ -2696,7 +2696,7 @@ impl AcpThreadView {}fn render_thinking_control(&self, cx: &mut Context<Self>) -> Option<AnyElement> {- if !cx.has_flag::<CloudThinkingToggleFeatureFlag>() {+ if !cx.has_flag::<CloudThinkingEffortFeatureFlag>() {return None;}diff --git a/crates/feature_flags/src/flags.rs b/crates/feature_flags/src/flags.rsindex ebe67c43ab7..43f4898da40 100644--- a/crates/feature_flags/src/flags.rs+++ b/crates/feature_flags/src/flags.rs@@ -60,11 +60,12 @@ impl FeatureFlag for DiffReviewFeatureFlag {}}-/// Controls whether we show the new thinking toggle in the Agent Panel when using models through the Zed provider (Cloud).-pub struct CloudThinkingToggleFeatureFlag;+/// Controls whether we show the new thinking and effort level controls in the Agent Panel when using applicable models+/// through the Zed provider (Cloud).+pub struct CloudThinkingEffortFeatureFlag;-impl FeatureFlag for CloudThinkingToggleFeatureFlag {- const NAME: &'static str = "cloud-thinking-toggle";+impl FeatureFlag for CloudThinkingEffortFeatureFlag {+ const NAME: &'static str = "cloud-thinking-effort";fn enabled_for_staff() -> bool {falsediff --git a/crates/language_models/src/provider/cloud.rs b/crates/language_models/src/provider/cloud.rsindex 6f9f500713c..ae344bb245d 100644--- a/crates/language_models/src/provider/cloud.rs+++ b/crates/language_models/src/provider/cloud.rs@@ -9,7 +9,7 @@ use cloud_llm_client::{CompletionEvent, CountTokensBody, CountTokensResponse, ListModelsResponse,SERVER_SUPPORTS_STATUS_MESSAGES_HEADER_NAME, ZED_VERSION_HEADER_NAME,};-use feature_flags::{CloudThinkingToggleFeatureFlag, FeatureFlagAppExt as _};+use feature_flags::{CloudThinkingEffortFeatureFlag, FeatureFlagAppExt as _};use futures::{AsyncBufReadExt, FutureExt, Stream, StreamExt, future::BoxFuture, stream::BoxStream,};@@ -168,14 +168,14 @@ impl State {}fn update_models(&mut self, response: ListModelsResponse, cx: &mut Context<Self>) {- let is_thinking_toggle_enabled = cx.has_flag::<CloudThinkingToggleFeatureFlag>();+ let is_thinking_effort_enabled = cx.has_flag::<CloudThinkingEffortFeatureFlag>();let mut models = Vec::new();for model in response.models {models.push(Arc::new(model.clone()));- if !is_thinking_toggle_enabled {+ if !is_thinking_effort_enabled {// Right now we represent thinking variants of models as separate models on the client,// so we need to insert variants for any model that supports thinking.if model.supports_thinking {@@ -740,9 +740,9 @@ impl LanguageModel for CloudLanguageModel {let intent = request.intent;let app_version = Some(cx.update(|cx| AppVersion::global(cx)));let thinking_allowed = request.thinking_allowed;- let is_thinking_toggle_enabled =- cx.update(|cx| cx.has_flag::<CloudThinkingToggleFeatureFlag>());- let enable_thinking = if is_thinking_toggle_enabled {+ let is_thinking_effort_enabled =+ cx.update(|cx| cx.has_flag::<CloudThinkingEffortFeatureFlag>());+ let enable_thinking = if is_thinking_effort_enabled {thinking_allowed && self.model.supports_thinking} else {thinking_allowed && self.model.id.0.ends_with("-thinking")