Repository navigation
.NET: Make default A2A hosting message-only - #10454
Merged
Merged
Conversation
The default A2A handler returns messages only, so the default server no longer resolves or allocates a task store and rejects task operations with UnsupportedOperation. Custom IAgentHandler registrations keep the existing task store behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SergeyMenshykh
temporarily deployed
to
integration
November 26, 2026 19:22 — with
GitHub Actions
Inactive
SergeyMenshykh
temporarily deployed
to
integration
November 26, 2026 19:22 — with
GitHub Actions
Inactive
SergeyMenshykh
marked this pull request as ready for review
November 26, 2026 19:24
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the message-only default A2A hosting change.
No open issues 🎉
What changed in this PR
Completes the message-only default A2A hosting path introduced in #10037, removing task-store resolution while preserving task support for custom handlers. No public APIs change.
Changes:
- Adds a message-only server that rejects task operations and task references before agent execution or streaming.
- Preserves custom-handler task storage and isolation, with tests covering both HTTP+JSON and JSON-RPC.
- Updates documentation and sample comments to distinguish default session isolation from custom-handler task isolation.
| File | Description |
|---|---|
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AServerServiceCollectionExtensionsTests.cs |
Verifies default task-store avoidance and retains custom-handler isolation coverage. |
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AEndpointRouteBuilderExtensionsTests.cs |
Tests message responses and task rejection across both bindings. |
dotnet/src/Microsoft.Agents.AI.Hosting.A2A/MessageOnlyA2AServer.cs |
Implements message-only handling and task-operation rejection. |
dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2AServerServiceCollectionExtensions.cs |
Selects the message-only default while preserving custom-handler storage. |
dotnet/src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/A2AEndpointRouteBuilderExtensions.cs |
Clarifies task support and isolation in XML documentation. |
dotnet/samples/05-end-to-end/A2AClientServer/README.md |
Removes default task-isolation guidance. |
dotnet/samples/05-end-to-end/A2AClientServer/AUTHENTICATION.md |
Focuses isolation guidance on retained agent sessions. |
dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/Program.cs |
Updates isolation comments without changing sample behavior. |
dotnet/samples/04-hosting/README.md |
Distinguishes default session isolation from custom-handler task isolation. |
Review effort: Balanced
Contributor
Code coverage overviewLanguages: C# C# / code-coverage/dotnet
View coverage of the 5 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
SergeyMenshykh
enabled auto-merge
November 26, 2026 19:41
westey (westey-m)
approved these changes
Nov 27, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Task support in the default A2A handler was postponed in #10037, but the default server still resolved a keyed
ITaskStore(or created anInMemoryTaskStore) and exposed task operations. Applications should not need to think about task-related services when tasks are not supported.Description
MessageOnlyA2AServerused when no customIAgentHandleris registered for the agent. It does not resolve or allocate a task store.UnsupportedOperationon both HTTP+JSON and JSON-RPC bindings, before the agent runs or a stream opens.contextIdstill continues a conversation.IAgentHandlerregistrations keep the existing task store lookup, in-memory fallback, and isolation wrapper.Related Issue
Follow-up to #10037.