From 5fe8cb9510eea4afdda80806d3b4bb631fde8c9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 05:22:03 +0000 Subject: [PATCH 1/2] Bump Microsoft.VisualStudio.Threading.Analyzers from 17.14.15 to 18.7.23 --- updated-dependencies: - dependency-name: Microsoft.VisualStudio.Threading.Analyzers dependency-version: 18.7.23 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4167b7ac..c270b4b3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,7 @@ - + From 9767b11401b5560a87a2300cb88d60698010a3e3 Mon Sep 17 00:00:00 2001 From: "Darrel Miller (from Dev Box)" Date: Tue, 18 Aug 2026 09:01:48 -0400 Subject: [PATCH 2/2] fix: suppress VSTHRD103 for JsonSerializer.Serialize to string These calls serialize JSON to a string value (not to a stream), so they are not blocking I/O. The result is then written asynchronously. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/A2A.AspNetCore/A2AHttpProcessor.cs | 2 ++ src/A2A.AspNetCore/JsonRpcStreamedResult.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/A2A.AspNetCore/A2AHttpProcessor.cs b/src/A2A.AspNetCore/A2AHttpProcessor.cs index 34e16973..5074a785 100644 --- a/src/A2A.AspNetCore/A2AHttpProcessor.cs +++ b/src/A2A.AspNetCore/A2AHttpProcessor.cs @@ -289,8 +289,10 @@ public async Task ExecuteAsync(HttpContext httpContext) { await foreach (var taskEvent in _events.WithCancellation(httpContext.RequestAborted)) { + #pragma warning disable VSTHRD103 // Serialize to string is not blocking I/O var json = JsonSerializer.Serialize(taskEvent, A2AJsonUtilities.DefaultOptions.GetTypeInfo(typeof(StreamResponse))); + #pragma warning restore VSTHRD103 await httpContext.Response.BodyWriter.WriteAsync( Encoding.UTF8.GetBytes($"data: {json}\n\n"), httpContext.RequestAborted); await httpContext.Response.BodyWriter.FlushAsync(httpContext.RequestAborted); diff --git a/src/A2A.AspNetCore/JsonRpcStreamedResult.cs b/src/A2A.AspNetCore/JsonRpcStreamedResult.cs index a6a2bc71..49494b99 100644 --- a/src/A2A.AspNetCore/JsonRpcStreamedResult.cs +++ b/src/A2A.AspNetCore/JsonRpcStreamedResult.cs @@ -61,7 +61,9 @@ await SseFormatter.WriteAsync( ? JsonRpcResponse.CreateJsonRpcErrorResponse(_requestId, a2aEx) : JsonRpcResponse.InternalErrorResponse( _requestId, "An internal error occurred during streaming."); + #pragma warning disable VSTHRD103 // Serialize to string is not blocking I/O var errorJson = JsonSerializer.Serialize(errorResponse, responseTypeInfo); + #pragma warning restore VSTHRD103 var errorBytes = Encoding.UTF8.GetBytes($"data: {errorJson}\n\n"); await httpContext.Response.Body.WriteAsync(errorBytes, httpContext.RequestAborted); await httpContext.Response.Body.FlushAsync(httpContext.RequestAborted);