fix: SwitchToAsync compat with local SDK build#647
Conversation
The local SDK build (0.3.0-local) has a 3-arg SwitchToAsync signature (modelId, reasoningEffort, cancellationToken) while v0.2.2 added a 4th ModelCapabilitiesOverride parameter. Remove the null placeholder to compile against both. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Multi-Model Code Review — PR #647Reviewed by: Direct review (1-line diff, no sub-agent dispatch needed) Findings🟡 MODERATE — #1: Breaks published SDK v0.2.2 buildFile: The PR removes the // Before (4-arg, matches SDK v0.2.2):
await state.Session.Rpc.Model.SwitchToAsync(normalizedModel, reasoningEffort, null, cancellationToken);
// After (3-arg, matches local SDK build):
await state.Session.Rpc.Model.SwitchToAsync(normalizedModel, reasoningEffort, cancellationToken);SDK v0.2.2 on NuGet only has the 4-arg overload — the 3-arg was removed in the v0.2.1→v0.2.2 upgrade. This PR compiles against a local SDK build (likely Impact: Anyone building from the published NuGet package (v0.2.2) will get a compile error: Recommendation: This is fine if the intent is to track the local SDK build temporarily. If so, consider adding a comment noting the SDK version dependency. If this should work with both, use Recommended Action✅ Approve (conditional)The change is correct for the local SDK build. The risk is limited since the |
|
Good catch — this is intentionally tracking the local SDK build which reverted to the 3-arg signature. The |
- McpLocalServerConfig → McpStdioServerConfig - McpRemoteServerConfig → McpHttpServerConfig - Dictionary<string, object> → Dictionary<string, McpServerConfig> - ParseMcpServerConfig returns McpServerConfig (not object) - Remove config.Type setter (now read-only virtual override) - SystemNotificationDataKindXxx → SystemNotificationXxx - UserMessageDataAttachmentsItem → UserMessageAttachment - Restore 4-arg SwitchToAsync (v0.3 re-added ModelCapabilitiesOverride) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Closing — the v0.3 SDK type renames (McpStdioServerConfig, SystemNotificationXxx, etc.) break compatibility with the published v0.2.2 NuGet package. The code on main already builds clean against v0.2.2. We'll update when v0.3 is published. |
One-line fix: removes the extra
nullarg fromSwitchToAsyncso it compiles against the local SDK (3-arg signature) instead of only v0.2.2 (4-arg withModelCapabilitiesOverride).