-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Three standalone MCP/customizations fixes: group-header casing, unclickable Show Output, duplicated server rows #330890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Ulugbek Abdullaev (ulugbekna)
merged 3 commits into
main
from
ulugbekna/mcp-standalone-fixes
Aug 17, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
75 changes: 75 additions & 0 deletions
75
...orkbench/contrib/chat/test/browser/agentSessions/agentHostMcpServerCustomizations.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import assert from 'assert'; | ||
| import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; | ||
| import { CustomizationType, McpServerStatus, type Customization, type DirectoryCustomization, type McpServerCustomization, type McpServerState, type PluginCustomization } from '../../../../../../platform/agentHost/common/state/protocol/state.js'; | ||
| import { getPresentableMcpServerCustomizations } from '../../../browser/agentSessions/agentHost/agentHostCustomizationService.js'; | ||
|
|
||
| suite('agent host MCP server customizations', () => { | ||
|
|
||
| ensureNoDisposablesAreLeakedInTestSuite(); | ||
|
|
||
| function mcpServer(id: string, name: string, state: McpServerState = { kind: McpServerStatus.Stopped }): McpServerCustomization { | ||
| return { type: CustomizationType.McpServer, id, uri: `file:///${encodeURIComponent(id)}`, name, state }; | ||
| } | ||
|
|
||
| function plugin(id: string, children: McpServerCustomization[]): PluginCustomization { | ||
| return { type: CustomizationType.Plugin, id, uri: `file:///${encodeURIComponent(id)}`, name: id, children }; | ||
| } | ||
|
|
||
| function directory(id: string, children: McpServerCustomization[]): DirectoryCustomization { | ||
| return { type: CustomizationType.Directory, id, uri: `file:///${encodeURIComponent(id)}`, name: id, enabled: true, writable: true, contents: CustomizationType.McpServer, children }; | ||
| } | ||
|
|
||
| function shown(customizations: readonly Customization[]): [string, string][] { | ||
| return getPresentableMcpServerCustomizations(customizations).map(({ server }) => [server.name, server.id]); | ||
| } | ||
|
|
||
| test('a server a plugin declares and the host also minted is shown once, as the live copy', () => { | ||
| // The shape an agent host actually publishes: the synced `.mcp.json` declares the server | ||
| // and never leaves `stopped`, while the minted top-level entry is the one it keeps current. | ||
| const declaration = mcpServer('file:///synced/.mcp.json#mcp=notion', 'notion'); | ||
| const live = mcpServer('mcp-top-level:copilotcli:session:notion', 'notion', { kind: McpServerStatus.Ready }); | ||
|
|
||
| assert.deepStrictEqual(shown([plugin('synced', [declaration]), live]), [ | ||
| ['notion', 'mcp-top-level:copilotcli:session:notion'], | ||
| ]); | ||
| }); | ||
|
|
||
| test('a server a directory declares and the host also minted is shown once, as the live copy', () => { | ||
| // A directory-declared child carries no owning plugin, so "has no plugin" cannot stand in | ||
| // for "is top-level": doing so would let this child claim the name and survive shadowing. | ||
| const declaration = mcpServer('file:///.mcp.json#mcp=notion', 'notion'); | ||
| const live = mcpServer('mcp-top-level:copilotcli:session:notion', 'notion', { kind: McpServerStatus.Ready }); | ||
|
|
||
| assert.deepStrictEqual(shown([directory('mcp-config', [declaration]), live]), [ | ||
| ['notion', 'mcp-top-level:copilotcli:session:notion'], | ||
| ]); | ||
| }); | ||
|
|
||
| test('a server only a container declares is kept, and so is one only the host minted', () => { | ||
| const declared = mcpServer('file:///synced/.mcp.json#mcp=cleanshot', 'cleanshot'); | ||
| const inDirectory = mcpServer('file:///.mcp.json#mcp=playwright', 'playwright'); | ||
| const minted = mcpServer('mcp-top-level:copilotcli:session:notion', 'notion', { kind: McpServerStatus.Ready }); | ||
|
|
||
| // Source order is preserved, exactly as it was before duplicates were collapsed. | ||
| assert.deepStrictEqual(shown([plugin('synced', [declared]), directory('mcp-config', [inDirectory]), minted]), [ | ||
| ['cleanshot', 'file:///synced/.mcp.json#mcp=cleanshot'], | ||
| ['playwright', 'file:///.mcp.json#mcp=playwright'], | ||
| ['notion', 'mcp-top-level:copilotcli:session:notion'], | ||
| ]); | ||
| }); | ||
|
|
||
| test('two plugins declaring the same name stay two servers, because they are two servers', () => { | ||
| assert.deepStrictEqual(shown([ | ||
| plugin('a', [mcpServer('file:///a/.mcp.json#mcp=search', 'search')]), | ||
| plugin('b', [mcpServer('file:///b/.mcp.json#mcp=search', 'search')]), | ||
| ]), [ | ||
| ['search', 'file:///a/.mcp.json#mcp=search'], | ||
| ['search', 'file:///b/.mcp.json#mcp=search'], | ||
| ]); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.