agent_ui: Refresh agent registry when reopening page (#50078)

Ben Brandt created

Make sure we get an up-to-date list whenever you actually visit the page

Release Notes:

- N/A

Change summary

crates/agent_ui/src/agent_ui.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

crates/agent_ui/src/agent_ui.rs 🔗

@@ -310,6 +310,10 @@ pub fn init(
                     .find_map(|item| item.downcast::<AgentRegistryPage>());
 
                 if let Some(existing) = existing {
+                    existing.update(cx, |_, cx| {
+                        project::AgentRegistryStore::global(cx)
+                            .update(cx, |store, cx| store.refresh(cx));
+                    });
                     workspace.activate_item(&existing, true, true, window, cx);
                 } else {
                     let registry_page = AgentRegistryPage::new(workspace, window, cx);