agent: Fix bug that prevented MCP servers to appear in the settings view (#33857)

Closes https://github.com/zed-industries/zed/issues/33827

After #33644 was merged, we would not start MCP servers coming from
extensions correctly anymore. The optimization uncovered a bug in the
implementation of `ContextServerDescriptorRegistry`, because we never
called `cx.notify()` when adding/removing context servers.
`ContextServerStore` listens for these events, and before #33644 this
was just working because of aace condition.

Release Notes:

- agent: Fixed bug that prevented MCP servers to appear in the settings
view.

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Danilo Leal
2025-07-03 15:05:29 +00:00
committed by GitHub
co-authored by Bennet Bo Fenner
parent cc0d8a411e
commit 34322ef1cd
3 changed files with 15 additions and 7 deletions
+2 -2
View File
@@ -818,9 +818,9 @@ mod tests {
.await;
let executor = cx.executor();
let registry = cx.new(|_| {
let registry = cx.new(|cx| {
let mut registry = ContextServerDescriptorRegistry::new();
registry.register_context_server_descriptor(SERVER_1_ID.into(), fake_descriptor_1);
registry.register_context_server_descriptor(SERVER_1_ID.into(), fake_descriptor_1, cx);
registry
});
let store = cx.new(|cx| {