28
29
export function countRunningMcpServersInOtherSessions(currentSession: URI, sessions: readonly IMcpEditorAgentHostSessionServers[]): Map<string, number> {
31
>
for (const session of sessions) {
32
>
if (isEqual(session.resource, currentSession)) {
33
>
continue;
34
>
}
35
>
const running = new Set<string>();
36
>
for (const server of session.servers) {
37
>
if (server.enabled && server.status === McpServerStatus.Ready) {
38
>
running.add(server.name);
39
>
}
40
>
}
41
>
for (const name of running) {
42
>
counts.set(name, (counts.get(name) ?? 0) + 1);
43
>
}
44
>
}
45
>
return counts;
46
>
}