Skip to content

Commit e86ab61

Browse files
github-actions[bot]stephentoubCopilot
authored
Update @github/copilot to 1.0.83-4 (#2507)
* Update Copilot CLI to 1.0.83-4 - Updated the Node.js CLI release pin - Re-ran code generators - Formatted generated code * Fix regenerated SDK compatibility Preserve optional-null wire semantics, advertise supported task kinds, and correct OAuth callback ordering across SDKs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Remove generated C# Optional wrapper Restore ordinary nullable generated APIs while the runtime contract is redesigned to avoid presence-sensitive null semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fix regenerated SDK test call sites Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Format Java model switch call Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Stabilize Python MCP OAuth tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Stabilize MCP OAuth startup tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Stabilize Node MCP OAuth startup tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Handle superseded MCP OAuth requests in tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Stabilize Rust MCP OAuth startup tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 81ffc2a commit e86ab61

86 files changed

Lines changed: 6479 additions & 277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dotnet/src/Client.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,8 @@ [new ConnectHandshakeRequest(
21862186
// Declare the integrating application's identity so the runtime attributes the
21872187
// telemetry it emits on this connection to a consistent surface instead
21882188
// of its own build. Null when the app didn't supply it.
2189-
ConnectHandshakeClientInfo.From(_options.ClientInfo))],
2189+
ConnectHandshakeClientInfo.From(_options.ClientInfo),
2190+
SupportedTaskKinds: [TaskKind.Agent, TaskKind.Client, TaskKind.Shell])],
21902191
connection.StderrBuffer,
21912192
cancellationToken);
21922193
serverVersion = (int)connectResponse.ProtocolVersion;
@@ -3198,7 +3199,8 @@ internal record GetSessionMetadataResponse(
31983199
internal record ConnectHandshakeRequest(
31993200
string? Token,
32003201
[property: JsonPropertyName("enableGitHubTelemetryForwarding")] bool? EnableGitHubTelemetryForwarding = null,
3201-
[property: JsonPropertyName("clientInfo")] ConnectHandshakeClientInfo? ClientInfo = null);
3202+
[property: JsonPropertyName("clientInfo")] ConnectHandshakeClientInfo? ClientInfo = null,
3203+
[property: JsonPropertyName("supportedTaskKinds")] IList<TaskKind>? SupportedTaskKinds = null);
32023204

32033205
internal record ConnectHandshakeClientInfo(
32043206
[property: JsonPropertyName("editorName")] string? EditorName = null,

dotnet/src/Generated/Rpc.cs

Lines changed: 1298 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/src/Generated/SessionEvents.cs

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/test/E2E/McpOAuthE2ETests.cs

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Diagnostics;
88
using System.Net.Http;
99
using System.Text.Json;
10+
using System.Threading.Channels;
1011
using Xunit;
1112
using Xunit.Abstractions;
1213

@@ -48,6 +49,7 @@ public async Task Should_Satisfy_MCP_OAuth_Using_Host_Provided_Token()
4849
}
4950
});
5051

52+
await session.Rpc.Mcp.ReloadAsync();
5153
await WaitForMcpServerStatusAsync(session, serverName, McpServerStatus.Connected);
5254
var tools = await session.Rpc.Mcp.ListToolsAsync(serverName);
5355
Assert.Contains(tools.Tools, tool => tool.Name == "whoami");
@@ -75,14 +77,14 @@ public async Task Should_Resolve_Pending_MCP_OAuth_Request_With_Direct_Rpc()
7577
{
7678
await using var oauthServer = await OAuthMcpServer.StartAsync(ExpectedToken);
7779
var serverName = "oauth-direct-rpc-mcp";
78-
var authRequest = new TaskCompletionSource<McpAuthContext>(TaskCreationOptions.RunContinuationsAsynchronously);
80+
var authRequests = Channel.CreateUnbounded<McpAuthContext>();
7981
var releaseHandler = new TaskCompletionSource<McpAuthResult?>(TaskCreationOptions.RunContinuationsAsynchronously);
8082

8183
await using var session = await CreateSessionAsync(new SessionConfig
8284
{
8385
OnMcpAuthRequest = request =>
8486
{
85-
authRequest.TrySetResult(request);
87+
authRequests.Writer.TryWrite(request);
8688
return releaseHandler.Task;
8789
},
8890
McpServers = new Dictionary<string, McpServerConfig>
@@ -95,30 +97,39 @@ public async Task Should_Resolve_Pending_MCP_OAuth_Request_With_Direct_Rpc()
9597
},
9698
});
9799

100+
var reload = session.Rpc.Mcp.ReloadAsync();
98101
var connected = WaitForMcpServerStatusAsync(session, serverName, McpServerStatus.Connected);
99-
var request = await authRequest.Task.WaitAsync(TimeSpan.FromSeconds(30));
102+
var request = await authRequests.Reader.ReadAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(30));
103+
104+
while (true)
105+
{
106+
var handled = await session.Rpc.Mcp.Oauth.HandlePendingRequestAsync(
107+
request.RequestId,
108+
new McpOauthPendingRequestResponseToken
109+
{
110+
AccessToken = ExpectedToken,
111+
TokenType = "Bearer",
112+
ExpiresIn = 3600,
113+
});
114+
if (handled.Success)
115+
{
116+
break;
117+
}
118+
request = await authRequests.Reader.ReadAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(30));
119+
}
120+
100121
Assert.NotEmpty(request.RequestId);
101122
Assert.Equal(serverName, request.ServerName);
102123
Assert.Equal($"{oauthServer.Url}/mcp", request.ServerUrl);
103124
Assert.Equal(McpOauthRequestReason.Initial, request.Reason);
104125
Assert.NotNull(request.WwwAuthenticateParams);
105126
Assert.Equal("mcp.read", request.WwwAuthenticateParams!.Scope);
106127

107-
var handled = await session.Rpc.Mcp.Oauth.HandlePendingRequestAsync(
108-
request.RequestId,
109-
new McpOauthPendingRequestResponseToken
110-
{
111-
AccessToken = ExpectedToken,
112-
TokenType = "Bearer",
113-
ExpiresIn = 3600,
114-
});
115-
Assert.True(handled.Success);
116-
128+
releaseHandler.SetResult(McpAuthResult.FromToken(new McpAuthToken { AccessToken = ExpectedToken }));
129+
await reload;
117130
await connected;
118131
var tools = await session.Rpc.Mcp.ListToolsAsync(serverName);
119132
Assert.Contains(tools.Tools, tool => tool.Name == "whoami");
120-
121-
releaseHandler.SetResult(McpAuthResult.FromToken(new McpAuthToken { AccessToken = ExpectedToken }));
122133
}
123134

124135
[Fact]
@@ -178,14 +189,16 @@ public async Task Should_Request_Replacement_Tokens_Across_MCP_OAuth_Lifecycle()
178189
}
179190
});
180191

192+
await session.Rpc.Mcp.ReloadAsync();
181193
await WaitForMcpServerStatusAsync(session, serverName, McpServerStatus.Connected);
194+
refreshCount = 0;
182195
await CallWhoamiAsync(session, serverName, "refresh");
183196
await CallWhoamiAsync(session, serverName, "upscope");
184197
await CallWhoamiAsync(session, serverName, "reauth");
185198

199+
observedReasons.RemoveAll(reason => reason == McpOauthRequestReason.Initial);
186200
Assert.Equal(
187201
[
188-
McpOauthRequestReason.Initial,
189202
McpOauthRequestReason.Refresh,
190203
McpOauthRequestReason.Upscope,
191204
McpOauthRequestReason.Refresh,
@@ -223,6 +236,7 @@ public async Task Should_Cancel_Pending_MCP_OAuth_Request()
223236
}
224237
});
225238

239+
await session.Rpc.Mcp.ReloadAsync();
226240
await WaitForMcpServerStatusAsync(session, serverName, McpServerStatus.NeedsAuth);
227241

228242
// The MCP connection is kicked off by session.create, but the SDK only registers its

dotnet/test/Unit/GitHubTelemetryTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public async Task Connect_Does_Not_Opt_In_Without_Handler()
138138
Assert.True(
139139
!present || flag.ValueKind == JsonValueKind.Null,
140140
"connect request should omit enableGitHubTelemetryForwarding (or send null) when no handler is registered");
141+
Assert.Equal(
142+
["agent", "client", "shell"],
143+
connectParams.GetProperty("supportedTaskKinds").EnumerateArray().Select(kind => kind.GetString()));
141144
}
142145

143146
[Fact]

0 commit comments

Comments
 (0)