Skip to content

Commit 56ba3cf

Browse files
stephentoubCopilot
andcommitted
Fix clone comparer preservation and byok doc example
Preserve dictionary comparer in SessionConfig/ResumeSessionConfig Clone() by checking for Dictionary<> and passing its Comparer. Fix byok.md to use Task.FromResult<IList<ModelInfo>>() for the updated delegate signature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 32c7b99 commit 56ba3cf

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/auth/byok.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ using GitHub.Copilot.SDK;
426426

427427
var client = new CopilotClient(new CopilotClientOptions
428428
{
429-
OnListModels = (ct) => Task.FromResult(new List<ModelInfo>
429+
OnListModels = (ct) => Task.FromResult<IList<ModelInfo>>(new List<ModelInfo>
430430
{
431431
new()
432432
{

dotnet/src/Types.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,9 @@ protected SessionConfig(SessionConfig? other)
17001700
Hooks = other.Hooks;
17011701
InfiniteSessions = other.InfiniteSessions;
17021702
McpServers = other.McpServers is not null
1703-
? new Dictionary<string, McpServerConfig>(other.McpServers)
1703+
? (other.McpServers is Dictionary<string, McpServerConfig> dict
1704+
? new Dictionary<string, McpServerConfig>(dict, dict.Comparer)
1705+
: new Dictionary<string, McpServerConfig>(other.McpServers))
17041706
: null;
17051707
Model = other.Model;
17061708
ModelCapabilities = other.ModelCapabilities;
@@ -1928,7 +1930,9 @@ protected ResumeSessionConfig(ResumeSessionConfig? other)
19281930
Hooks = other.Hooks;
19291931
InfiniteSessions = other.InfiniteSessions;
19301932
McpServers = other.McpServers is not null
1931-
? new Dictionary<string, McpServerConfig>(other.McpServers)
1933+
? (other.McpServers is Dictionary<string, McpServerConfig> dict
1934+
? new Dictionary<string, McpServerConfig>(dict, dict.Comparer)
1935+
: new Dictionary<string, McpServerConfig>(other.McpServers))
19321936
: null;
19331937
Model = other.Model;
19341938
ModelCapabilities = other.ModelCapabilities;

0 commit comments

Comments
 (0)