Skip to content

Commit 1cfe0c5

Browse files
committed
Address PR feedback
1 parent 265107f commit 1cfe0c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ModelContextProtocol/Protocol/Transport/SseResponseStreamTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public ValueTask DisposeAsync()
6161
}
6262

6363
/// <inheritdoc/>
64-
public Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default)
64+
public async Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default)
6565
{
6666
if (_sseWriteTask is null)
6767
{
6868
throw new InvalidOperationException($"Transport is not connected. Make sure to call {nameof(RunAsync)} first.");
6969
}
7070

71-
return _outgoingSseChannel.Writer.WriteAsync(new SseItem<IJsonRpcMessage?>(message), cancellationToken).AsTask();
71+
await _outgoingSseChannel.Writer.WriteAsync(new SseItem<IJsonRpcMessage?>(message), cancellationToken).AsTask();
7272
}
7373

7474
/// <summary>
@@ -78,14 +78,14 @@ public Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancella
7878
/// <param name="cancellationToken">A token to cancel the operation.</param>
7979
/// <returns>A task representing the potentially asynchronous operation to buffer or process the JSON-RPC message.</returns>
8080
/// <exception cref="InvalidOperationException">Thrown when there is an attempt to process a message before calling <see cref="RunAsync(CancellationToken)"/>.</exception>
81-
public Task OnMessageReceivedAsync(IJsonRpcMessage message, CancellationToken cancellationToken)
81+
public async Task OnMessageReceivedAsync(IJsonRpcMessage message, CancellationToken cancellationToken)
8282
{
8383
if (_sseWriteTask is null)
8484
{
8585
throw new InvalidOperationException($"Transport is not connected. Make sure to call {nameof(RunAsync)} first.");
8686
}
8787

88-
return _incomingChannel.Writer.WriteAsync(message, cancellationToken).AsTask();
88+
await _incomingChannel.Writer.WriteAsync(message, cancellationToken).AsTask();
8989
}
9090

9191
private static Channel<T> CreateSingleItemChannel<T>() =>

0 commit comments

Comments
 (0)