Repository navigation
.NET: Add gRPC protocol selection to the A2A sample - #9563
SergeyMenshykh merged 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8c7bf38b-4be3-419a-b383-4ba1055fd003
There was a problem hiding this comment.
🟢 Approval recommended
The scoped sample and documentation changes match the existing integration and pinned SDK behavior, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Adds gRPC selection to the .NET A2A sample using the existing client abstraction, without changing framework behavior or public APIs.
Changes:
- Adds configurable protocol selection, explicit gRPC registration, and client disposal.
- Adds a sample-only gRPC dependency.
- Documents discovery-based and direct gRPC connections.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2ACardResolverExtensions.cs | Documents gRPC discovery setup. |
| dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AAgentCardExtensions.cs | Documents registration and client ownership. |
| dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs | Updates supported-response and direct-client documentation. |
| dotnet/samples/02-agents/A2A/README.md | Adds gRPC to the sample listing. |
| dotnet/samples/02-agents/A2A/A2AAgent_ProtocolSelection/README.md | Explains protocol selection and gRPC setup. |
| dotnet/samples/02-agents/A2A/A2AAgent_ProtocolSelection/Program.cs | Implements binding selection, registration, and disposal. |
| dotnet/samples/02-agents/A2A/A2AAgent_ProtocolSelection/A2AAgent_ProtocolSelection.csproj | References the gRPC SDK package. |
| dotnet/Directory.Packages.props | Pins the gRPC SDK package version. |
Review effort: Balanced
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): b43d25322df5
Model: gpt-5.6-sol
Overview
The change adds optional gRPC selection to the existing A2A protocol sample while keeping the framework package isolated from gRPC dependencies. Explicit startup registration, strict single-binding selection, caller-owned client disposal, existing protocol-selection tests, and the pinned SDK's case-insensitive factory behavior prevent a publishable correctness, architectural, or security concern.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
The A2A .NET SDK provides a gRPC client that already works with
A2AAgentthroughIA2AClient. The existing sample and documentation do not show how to use it.Description & Review Guide
A2A.Grpconly from the sample; keep the base package's dependencies, public APIs, and hosting unchanged.AI Assistance
AI assistance details: Copilot helped update the sample, revise the documentation, and prepare this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.