agent: Disables multi workspace refresh queue for non-staff (#49496)

Anthony Eid created

Refreshing the queue was causing hangs on debug builds, so this is a
short term fix until we rework how the sidebar gets its data.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

Change summary

crates/sidebar/src/sidebar.rs           | 5 +++++
crates/workspace/src/multi_workspace.rs | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)

Detailed changes

crates/sidebar/src/sidebar.rs 🔗

@@ -2,6 +2,7 @@ use acp_thread::ThreadStatus;
 use agent_ui::{AgentPanel, AgentPanelEvent};
 use chrono::{Datelike, Local, NaiveDate, TimeDelta};
 use db::kvp::KEY_VALUE_STORE;
+
 use fs::Fs;
 use fuzzy::StringMatchCandidate;
 use gpui::{
@@ -993,6 +994,10 @@ impl Sidebar {
         cx: &mut Context<Self>,
     ) {
         cx.defer_in(window, move |this, window, cx| {
+            if !this.multi_workspace.read(cx).multi_workspace_enabled(cx) {
+                return;
+            }
+
             this._project_subscriptions = this.subscribe_to_projects(window, cx);
             this._agent_panel_subscriptions = this.subscribe_to_agent_panels(window, cx);
             this._thread_subscriptions = this.subscribe_to_threads(window, cx);

crates/workspace/src/multi_workspace.rs 🔗

@@ -144,7 +144,7 @@ impl MultiWorkspace {
             .map_or(false, |s| s.has_notifications(cx))
     }
 
-    pub(crate) fn multi_workspace_enabled(&self, cx: &App) -> bool {
+    pub fn multi_workspace_enabled(&self, cx: &App) -> bool {
         cx.has_flag::<AgentV2FeatureFlag>()
     }