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

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-08-20 15:02:40 +02:00 committed by GitHub
parent 6ed29fbc34
commit de12633591
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(