fix(acp-bridge): forget a replaced child's runtime MCP servers (#14527)

Names recorded on channel A survived a replace to channel B until the next hasRuntimeMcpServers() call. An add on B then adopted them, so removing B's own server still reported the runtime as holding one. Clear the set when the live child changes before recording a new name.

Refs #14488
This commit is contained in:
Shaojin Wen 2026-10-18 13:01:21 +08:00 • committed by GitHub
parent 53a76e4088
commit 95a55ff511
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16173,7 +16173,12 @@ export function createSessionControlPlane(
const addSkipped = (response as { skipped?: boolean }).skipped === true;
if (!addSkipped) {
const ok = response as AddOk;
runtimeMcpServerChannelId = info.id;
// Names recorded on a replaced child are gone with it; do not let
// a later add on the new child inherit them.
if (runtimeMcpServerChannelId !== info.id) {
runtimeMcpServerNames.clear();
runtimeMcpServerChannelId = info.id;
}
runtimeMcpServerNames.add(ok.name);
broadcastWorkspaceEvent({
type: 'mcp_server_added',