.NET: Map additional props <-> A2A metadata#3137
Merged
SergeyMenshykh merged 10 commits intomicrosoft:mainfrom Jan 8, 2026
Merged
.NET: Map additional props <-> A2A metadata#3137SergeyMenshykh merged 10 commits intomicrosoft:mainfrom
SergeyMenshykh merged 10 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements bidirectional mapping of additional properties between the Agent Framework and A2A protocol metadata:
- Maps
AgentRunOptions.AdditionalPropertiestoA2A.MessageSendParams.Metadatawhen sending messages to A2A agents - Maps incoming
A2A.MessageSendParams.MetadatatoAgentRunOptions.AdditionalPropertiesin the A2A hosting layer - Maps
AgentRunResult.AdditionalPropertiestoA2AResponse.Metadatawhen returning responses from hosted agents
Key changes:
- Adds extension methods to convert between
AdditionalPropertiesDictionaryand A2A metadata format (Dictionary<string, JsonElement>) - Updates A2AAgent to propagate AdditionalProperties to/from A2A calls
- Updates AIAgentExtensions hosting layer to handle metadata bidirectionally
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.A2A/Extensions/AdditionalPropertiesDictionaryExtensions.cs | New extension method to convert AdditionalPropertiesDictionary to A2A metadata format |
| dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AMetadataExtensions.cs | Adds documentation remarks to existing ToAdditionalProperties method |
| dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs | Updates RunCoreAsync and RunCoreStreamingAsync to propagate AdditionalProperties to/from A2A calls; simplifies Name and Description properties |
| dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Converters/AdditionalPropertiesDictionaryExtensions.cs | New extension method to convert AdditionalPropertiesDictionary to A2A metadata format (duplicate of A2A project version) |
| dotnet/src/Microsoft.Agents.AI.Hosting.A2A/Converters/A2AMetadataExtensions.cs | New extension method to convert A2A metadata to AdditionalPropertiesDictionary (duplicate of A2A project version) |
| dotnet/src/Microsoft.Agents.AI.Hosting.A2A/AIAgentExtensions.cs | Updates MapA2A to convert incoming metadata to options and outgoing response properties to metadata |
| dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/Extensions/AdditionalPropertiesDictionaryExtensionsTests.cs | Comprehensive unit tests for ToA2AMetadata extension method |
| dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/A2AAgentTests.cs | Tests for AdditionalProperties propagation in RunAsync and RunStreamingAsync |
| dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/AIAgentExtensionsTests.cs | Tests for metadata/AdditionalProperties bidirectional conversion in hosting layer |
...t/src/Microsoft.Agents.AI.Hosting.A2A/Converters/AdditionalPropertiesDictionaryExtensions.cs
Show resolved
Hide resolved
...t/src/Microsoft.Agents.AI.Hosting.A2A/Converters/AdditionalPropertiesDictionaryExtensions.cs
Show resolved
Hide resolved
markwallace-microsoft
approved these changes
Jan 8, 2026
...t/src/Microsoft.Agents.AI.Hosting.A2A/Converters/AdditionalPropertiesDictionaryExtensions.cs
Show resolved
Hide resolved
…b.com/SergeyMenshykh/agent-framework into a2a-map-metadata-and-additional-props
westey-m
reviewed
Jan 8, 2026
dotnet/src/Microsoft.Agents.AI.A2A/Extensions/AdditionalPropertiesDictionaryExtensions.cs
Show resolved
Hide resolved
westey-m
approved these changes
Jan 8, 2026
This was referenced Feb 10, 2026
This was referenced Feb 18, 2026
This was referenced Feb 25, 2026
Open
Open
This was referenced Mar 7, 2026
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 and Context
Currently, the AF A2A agent does not pass the additional properties from the agent run options down to the A2A agent. Moreover, the A2A hosting layer does not pass the metadata received in the A2A call to the run options of an underlying agent and does not return the additional properties returned by the underlying agent in the A2A call result. This prevents consumers from passing additional data from AF to A2A and back. More details can be found here: #2974
Description
This PR:
AgentRunOptions.AdditionalPropertiestoA2A.MessageSendParams.Metadata.NameandDescriptionproperties.A2A.MessageSendParams.MetadatatoAgentRunOptions.AdditionalProperties.AgentRunResult.AdditionalPropertiestoA2AResponse.