diff --git a/dotnet/src/Client.cs b/dotnet/src/Client.cs index 8e4d1eefb..c1fa14f81 100644 --- a/dotnet/src/Client.cs +++ b/dotnet/src/Client.cs @@ -942,7 +942,7 @@ public async Task SetForegroundSessionIdAsync(string sessionId, CancellationToke var connection = await EnsureConnectedAsync(cancellationToken); var response = await InvokeRpcAsync( - connection.Rpc, "session.setForeground", [new { sessionId }], cancellationToken); + connection.Rpc, "session.setForeground", [new SetForegroundSessionRequest(sessionId)], cancellationToken); if (!response.Success) { @@ -1753,6 +1753,9 @@ internal record GetSessionMetadataRequest( internal record GetSessionMetadataResponse( SessionMetadata? Session); + internal record SetForegroundSessionRequest( + string SessionId); + internal record UserInputRequestResponse( string Answer, bool WasFreeform); @@ -1871,6 +1874,7 @@ private static LogLevel MapLevel(TraceEventType eventType) [JsonSerializable(typeof(SessionCapabilities))] [JsonSerializable(typeof(SessionUiCapabilities))] [JsonSerializable(typeof(SessionMetadata))] + [JsonSerializable(typeof(SetForegroundSessionRequest))] [JsonSerializable(typeof(SystemMessageConfig))] [JsonSerializable(typeof(SystemMessageTransformRpcResponse))] [JsonSerializable(typeof(CommandWireDefinition))]