Tighten draft protocol negotiation boundaries (#1692)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
a8d374b280
commit
fd38f51e27
4 changed files with 1755 additions and 589 deletions
|
|
@ -130,10 +130,10 @@ public partial class McpServerBuilderExtensionsPromptsTests : ClientServerTestBa
|
|||
{
|
||||
// Under the 2026-07-28 protocol, list-changed notifications are delivered only over a
|
||||
// subscriptions/listen stream (covered by SubscriptionsListenTests). This test pins the
|
||||
// legacy revision to keep coverage of the session-wide broadcast that legacy clients still rely on.
|
||||
// initialize-handshake revision to keep coverage of the session-wide broadcast that older clients still rely on.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ public partial class McpServerBuilderExtensionsPromptsTests : ClientServerTestBa
|
|||
// subscriptions/listen stream. Pin the legacy revision to test the session-wide broadcast.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
var serverOptions = ServiceProvider.GetRequiredService<IOptions<McpServerOptions>>().Value;
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ public class McpServerBuilderExtensionsRequestFilterTests(ITestOutputHelper test
|
|||
[Fact]
|
||||
public async Task AddSetLoggingLevelFilter_Logs_When_SetLoggingLevel_Called()
|
||||
{
|
||||
await using McpClient client = await CreateMcpClientForServer();
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions { ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion });
|
||||
|
||||
await client.SetLoggingLevelAsync(LoggingLevel.Info, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
|
|
|
|||
|
|
@ -164,10 +164,10 @@ public partial class McpServerBuilderExtensionsResourcesTests : ClientServerTest
|
|||
{
|
||||
// Under the 2026-07-28 protocol, list-changed notifications are delivered only over a
|
||||
// subscriptions/listen stream (covered by SubscriptionsListenTests). This test pins the
|
||||
// legacy revision to keep coverage of the session-wide broadcast that legacy clients still rely on.
|
||||
// initialize-handshake revision to keep coverage of the session-wide broadcast that older clients still rely on.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ public partial class McpServerBuilderExtensionsResourcesTests : ClientServerTest
|
|||
// subscriptions/listen stream. Pin the legacy revision to test the session-wide broadcast.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
var serverOptions = ServiceProvider.GetRequiredService<IOptions<McpServerOptions>>().Value;
|
||||
|
|
|
|||
|
|
@ -190,10 +190,10 @@ public partial class McpServerBuilderExtensionsToolsTests : ClientServerTestBase
|
|||
{
|
||||
// Under the 2026-07-28 protocol, list-changed notifications are delivered only over a
|
||||
// subscriptions/listen stream (covered by SubscriptionsListenTests). This test pins the
|
||||
// legacy revision to keep coverage of the session-wide broadcast that legacy clients still rely on.
|
||||
// initialize-handshake revision to keep coverage of the session-wide broadcast that older clients still rely on.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
var tools = await client.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
|
@ -239,7 +239,7 @@ public partial class McpServerBuilderExtensionsToolsTests : ClientServerTestBase
|
|||
// subscriptions/listen stream. Pin the legacy revision to test the session-wide broadcast.
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions
|
||||
{
|
||||
ProtocolVersion = McpHttpHeaders.November2025ProtocolVersion,
|
||||
ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion,
|
||||
});
|
||||
|
||||
var serverOptions = ServiceProvider.GetRequiredService<IOptions<McpServerOptions>>().Value;
|
||||
|
|
|
|||
Loading…
Reference in a new issue