Skip to content

Notify after populating MCP server IDs#50089

Merged
tomhoule merged 1 commit intomainfrom
tomhoule-xyzlmllyrqxw
Feb 25, 2026
Merged

Notify after populating MCP server IDs#50089
tomhoule merged 1 commit intomainfrom
tomhoule-xyzlmllyrqxw

Conversation

@tomhoule
Copy link
Copy Markdown
Contributor

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.

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.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 25, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Feb 25, 2026
@tomhoule tomhoule marked this pull request as ready for review February 25, 2026 16:05
@tomhoule tomhoule merged commit f786e04 into main Feb 25, 2026
37 checks passed
@tomhoule tomhoule deleted the tomhoule-xyzlmllyrqxw branch February 25, 2026 16:48
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant