Notify after populating MCP server IDs#50089
Merged
Conversation
The AgentConfiguration view reads server_ids() from the ContextServerStore during render to decide whether to show MCP server entries or the "No MCP servers added yet" empty state. The server_ids field starts empty and is populated asynchronously by populate_server_ids, which runs after the maintain_servers loop completes. But after updating server_ids, the ContextServerStore never called cx.notify(), so views that read it were never scheduled for re-render. The UI would still update when at least one server changed status, because those events trigger the AgentConfiguration subscription which calls cx.notify(). That meant the bug was only visible when no servers actually started — for example when server creation failed due to a missing binary or a stalled remote connection. In that case server_ids got correctly populated from the settings keys, but no event fired and the agent settings view kept showing the empty state. This was easy to hit in practice: opening multiple workspaces with the same global settings.json, only the window where servers happened to start successfully would show the MCP server list. The others would show the empty state permanently. The fix adds cx.notify() after populate_server_ids so that the view always re-renders when the set of known server IDs changes.
tahayvr
pushed a commit
to tahayvr/zed
that referenced
this pull request
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AgentConfiguration view reads server_ids() from the ContextServerStore during render to decide whether to show MCP server entries or the "No MCP servers added yet" empty state. The server_ids field starts empty and is populated asynchronously by populate_server_ids, which runs after the maintain_servers loop completes. But after updating server_ids, the ContextServerStore never called cx.notify(), so views that read it were never scheduled for re-render.
The UI would still update when at least one server changed status, because those events trigger the AgentConfiguration subscription which calls cx.notify(). That meant the bug was only visible when no servers actually started. In that case server_ids got correctly populated from the settings keys, but no event fired and the agent settings view kept showing the empty state.
In practice, that means you can have several windows with the same global settings.json (so, same MCP servers), and in some windows, you will see them in the agent settings panel, and in others, "No MCP servers added".
The fix adds cx.notify() after populate_server_ids so that the view always re-renders when the set of known server IDs changes.
Release Notes:
-Fixed a UI bug where the agent panel settings would sometimes render the empty state ("No MCP server added yet"), even if there are MCP servers configured in settings.json. In particular, this happened when one of them was hanging on startup.