Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Wait for agent2 feature flag before loading panel (#36583)

Antonio Scandurrade12633591a7
diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs
index 3c4c403a770..286d3b1c26e 100644
--- a/crates/agent_ui/src/agent_panel.rs
+++ b/crates/agent_ui/src/agent_panel.rs
@@ -523,6 +523,7 @@ impl AgentPanel {
anyhow::Ok(())
}));
}
+
pub fn load(
workspace: WeakEntity<Workspace>,
prompt_builder: Arc<PromptBuilder>,
@@ -572,6 +573,17 @@ impl AgentPanel {
None
};
+ // Wait for the Gemini/Native feature flag to be available.
+ let client = workspace.read_with(cx, |workspace, _| workspace.client().clone())?;
+ if !client.status().borrow().is_signed_out() {
+ cx.update(|_, cx| {
+ cx.wait_for_flag_or_timeout::<feature_flags::GeminiAndNativeFeatureFlag>(
+ Duration::from_secs(2),
+ )
+ })?
+ .await;
+ }
+
let panel = workspace.update_in(cx, |workspace, window, cx| {
let panel = cx.new(|cx| {
Self::new(