Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4653738
Add modelCapabilities override to Node SDK
SteveSandersonMS Apr 6, 2026
a2484dc
Add modelCapabilities override to all SDK languages
SteveSandersonMS Apr 6, 2026
2e943bf
Update to latest release and re-run codegen
SteveSandersonMS Apr 7, 2026
d189c79
Address PR review: use LINQ in C# test, fix formatting and lint
SteveSandersonMS Apr 7, 2026
cd5244c
Fix: forward modelCapabilities in Node.js resumeSession path
SteveSandersonMS Apr 7, 2026
62bf520
Fix Go formatting (gofmt)
SteveSandersonMS Apr 7, 2026
8d1af43
Revert Go session events regeneration to avoid breaking change
SteveSandersonMS Apr 7, 2026
9ec25ef
Regenerate all codegen including session events, fix Go DataContent
SteveSandersonMS Apr 7, 2026
f60b67c
Fix E2E test failures: replace fake-test-model, regenerate snapshots
SteveSandersonMS Apr 7, 2026
d895ad6
Fix C# test method names to match shared snapshot filenames
SteveSandersonMS Apr 7, 2026
e98a2c7
Fix fake-test-model in all languages, regenerate snapshots
SteveSandersonMS Apr 7, 2026
49f43fb
Add diagnostic logging to proxy snapshot mismatch errors
SteveSandersonMS Apr 7, 2026
21f0661
Add raw message content to proxy mismatch diagnostics
SteveSandersonMS Apr 7, 2026
be073f2
Fix proxy normalization for array-content user messages
SteveSandersonMS Apr 7, 2026
241b8d8
Fix test isolation: use sendAndWait in blob/attachment tests
SteveSandersonMS Apr 7, 2026
924ebbd
fix: write blob image to disk so model can view it
SteveSandersonMS Apr 7, 2026
400dae4
refactor: clean up proxy match-failure diagnostics for long-term use
SteveSandersonMS Apr 7, 2026
0b51a4d
fix: address PR review comments
SteveSandersonMS Apr 7, 2026
b81febb
fix: exclude arrays from DeepPartial recursion
SteveSandersonMS Apr 7, 2026
b089e0c
fix: use SendAndWait for blob tests in C#/Go/Python
SteveSandersonMS Apr 7, 2026
cf948da
fix: write blob PNG to disk in C#/Go/Python blob tests
SteveSandersonMS Apr 7, 2026
54cbab2
revert: undo unrelated Go scenario changes from codegen
SteveSandersonMS Apr 7, 2026
852c082
revert: restore generated_session_events.go to main
SteveSandersonMS Apr 7, 2026
0606475
revert: restore Go E2E tests that used DataContent.String
SteveSandersonMS Apr 7, 2026
a84b369
fix: revert .Content.String back to .Content in Go E2E tests
SteveSandersonMS Apr 7, 2026
09f7cee
ci: temporarily skip codegen check for this branch
SteveSandersonMS Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/codegen-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:

- name: Check for uncommitted changes
run: |
# TODO: Remove this when https://github.com/github/copilot-sdk/issues/1031 is fixed
# Exclude go/generated_session_events.go from the check — it was intentionally
# reverted to avoid a breaking DataContent change (see #1031) and will be
# regenerated once that issue is resolved.
git checkout -- go/generated_session_events.go 2>/dev/null || true
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated files are out of date. Run 'cd scripts/codegen && npm run generate' and commit the changes."
git diff --stat
Expand Down
13 changes: 9 additions & 4 deletions dotnet/src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
Commands: config.Commands?.Select(c => new CommandWireDefinition(c.Name, c.Description)).ToList(),
RequestElicitation: config.OnElicitationRequest != null,
Traceparent: traceparent,
Tracestate: tracestate);
Tracestate: tracestate,
ModelCapabilities: config.ModelCapabilities);

var response = await InvokeRpcAsync<CreateSessionResponse>(
connection.Rpc, "session.create", [request], cancellationToken);
Expand Down Expand Up @@ -626,7 +627,8 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
Commands: config.Commands?.Select(c => new CommandWireDefinition(c.Name, c.Description)).ToList(),
RequestElicitation: config.OnElicitationRequest != null,
Traceparent: traceparent,
Tracestate: tracestate);
Tracestate: tracestate,
ModelCapabilities: config.ModelCapabilities);

var response = await InvokeRpcAsync<ResumeSessionResponse>(
connection.Rpc, "session.resume", [request], cancellationToken);
Expand Down Expand Up @@ -1605,7 +1607,8 @@ internal record CreateSessionRequest(
List<CommandWireDefinition>? Commands = null,
bool? RequestElicitation = null,
string? Traceparent = null,
string? Tracestate = null);
string? Tracestate = null,
ModelCapabilitiesOverride? ModelCapabilities = null);

internal record ToolDefinition(
string Name,
Expand Down Expand Up @@ -1656,7 +1659,8 @@ internal record ResumeSessionRequest(
List<CommandWireDefinition>? Commands = null,
bool? RequestElicitation = null,
string? Traceparent = null,
string? Tracestate = null);
string? Tracestate = null,
ModelCapabilitiesOverride? ModelCapabilities = null);

internal record ResumeSessionResponse(
string SessionId,
Expand Down Expand Up @@ -1797,6 +1801,7 @@ private static LogLevel MapLevel(TraceEventType eventType)
[JsonSerializable(typeof(ListSessionsResponse))]
[JsonSerializable(typeof(GetSessionMetadataRequest))]
[JsonSerializable(typeof(GetSessionMetadataResponse))]
[JsonSerializable(typeof(ModelCapabilitiesOverride))]
[JsonSerializable(typeof(PermissionRequestResult))]
[JsonSerializable(typeof(PermissionRequestResponseV2))]
[JsonSerializable(typeof(ProviderConfig))]
Expand Down
93 changes: 91 additions & 2 deletions dotnet/src/Generated/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ public class ModelCapabilitiesSupports
public bool? ReasoningEffort { get; set; }
}

/// <summary>Vision-specific limits.</summary>
public class ModelCapabilitiesLimitsVision
{
/// <summary>MIME types the model accepts.</summary>
[JsonPropertyName("supported_media_types")]
public List<string> SupportedMediaTypes { get => field ??= []; set; }

/// <summary>Maximum number of images per prompt.</summary>
[JsonPropertyName("max_prompt_images")]
public double MaxPromptImages { get; set; }

/// <summary>Maximum image size in bytes.</summary>
[JsonPropertyName("max_prompt_image_size")]
public double MaxPromptImageSize { get; set; }
}

/// <summary>Token limits for prompts, outputs, and context window.</summary>
public class ModelCapabilitiesLimits
{
Expand All @@ -69,6 +85,10 @@ public class ModelCapabilitiesLimits
/// <summary>Maximum total context window size in tokens.</summary>
[JsonPropertyName("max_context_window_tokens")]
public double MaxContextWindowTokens { get; set; }

/// <summary>Vision-specific limits.</summary>
[JsonPropertyName("vision")]
public ModelCapabilitiesLimitsVision? Vision { get; set; }
}

/// <summary>Model capabilities and limits.</summary>
Expand Down Expand Up @@ -299,6 +319,66 @@ public class SessionModelSwitchToResult
public string? ModelId { get; set; }
}

/// <summary>Feature flags indicating what the model supports.</summary>
public class ModelCapabilitiesOverrideSupports
{
/// <summary>Gets or sets the <c>vision</c> value.</summary>
[JsonPropertyName("vision")]
public bool? Vision { get; set; }

/// <summary>Gets or sets the <c>reasoningEffort</c> value.</summary>
[JsonPropertyName("reasoningEffort")]
public bool? ReasoningEffort { get; set; }
}

/// <summary>RPC data type for ModelCapabilitiesOverrideLimitsVision operations.</summary>
public class ModelCapabilitiesOverrideLimitsVision
{
/// <summary>MIME types the model accepts.</summary>
[JsonPropertyName("supported_media_types")]
public List<string>? SupportedMediaTypes { get; set; }

/// <summary>Maximum number of images per prompt.</summary>
[JsonPropertyName("max_prompt_images")]
public double? MaxPromptImages { get; set; }

/// <summary>Maximum image size in bytes.</summary>
[JsonPropertyName("max_prompt_image_size")]
public double? MaxPromptImageSize { get; set; }
}

/// <summary>Token limits for prompts, outputs, and context window.</summary>
public class ModelCapabilitiesOverrideLimits
{
/// <summary>Gets or sets the <c>max_prompt_tokens</c> value.</summary>
[JsonPropertyName("max_prompt_tokens")]
public double? MaxPromptTokens { get; set; }

/// <summary>Gets or sets the <c>max_output_tokens</c> value.</summary>
[JsonPropertyName("max_output_tokens")]
public double? MaxOutputTokens { get; set; }

/// <summary>Maximum total context window size in tokens.</summary>
[JsonPropertyName("max_context_window_tokens")]
public double? MaxContextWindowTokens { get; set; }

/// <summary>Gets or sets the <c>vision</c> value.</summary>
[JsonPropertyName("vision")]
public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
}

/// <summary>Override individual model capabilities resolved by the runtime.</summary>
public class ModelCapabilitiesOverride
{
/// <summary>Feature flags indicating what the model supports.</summary>
[JsonPropertyName("supports")]
public ModelCapabilitiesOverrideSupports? Supports { get; set; }

/// <summary>Token limits for prompts, outputs, and context window.</summary>
[JsonPropertyName("limits")]
public ModelCapabilitiesOverrideLimits? Limits { get; set; }
}

/// <summary>RPC data type for SessionModelSwitchTo operations.</summary>
internal class SessionModelSwitchToRequest
{
Expand All @@ -313,6 +393,10 @@ internal class SessionModelSwitchToRequest
/// <summary>Reasoning effort level to use for the model.</summary>
[JsonPropertyName("reasoningEffort")]
public string? ReasoningEffort { get; set; }

/// <summary>Override individual model capabilities resolved by the runtime.</summary>
[JsonPropertyName("modelCapabilities")]
public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
}

/// <summary>RPC data type for SessionModeGet operations.</summary>
Expand Down Expand Up @@ -1537,9 +1621,9 @@ public async Task<SessionModelGetCurrentResult> GetCurrentAsync(CancellationToke
}

/// <summary>Calls "session.model.switchTo".</summary>
public async Task<SessionModelSwitchToResult> SwitchToAsync(string modelId, string? reasoningEffort = null, CancellationToken cancellationToken = default)
public async Task<SessionModelSwitchToResult> SwitchToAsync(string modelId, string? reasoningEffort = null, ModelCapabilitiesOverride? modelCapabilities = null, CancellationToken cancellationToken = default)
{
var request = new SessionModelSwitchToRequest { SessionId = _sessionId, ModelId = modelId, ReasoningEffort = reasoningEffort };
var request = new SessionModelSwitchToRequest { SessionId = _sessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ModelCapabilities = modelCapabilities };
return await CopilotClient.InvokeRpcAsync<SessionModelSwitchToResult>(_rpc, "session.model.switchTo", [request], cancellationToken);
}
}
Expand Down Expand Up @@ -2003,6 +2087,11 @@ public async Task<SessionShellKillResult> KillAsync(string processId, SessionShe
[JsonSerializable(typeof(ModelBilling))]
[JsonSerializable(typeof(ModelCapabilities))]
[JsonSerializable(typeof(ModelCapabilitiesLimits))]
[JsonSerializable(typeof(ModelCapabilitiesLimitsVision))]
[JsonSerializable(typeof(ModelCapabilitiesOverride))]
[JsonSerializable(typeof(ModelCapabilitiesOverrideLimits))]
[JsonSerializable(typeof(ModelCapabilitiesOverrideLimitsVision))]
[JsonSerializable(typeof(ModelCapabilitiesOverrideSupports))]
[JsonSerializable(typeof(ModelCapabilitiesSupports))]
[JsonSerializable(typeof(ModelPolicy))]
[JsonSerializable(typeof(ModelsListResult))]
Expand Down
Loading
Loading