.NET: Send A2A session task id as message taskId#5465
Open
karimbaidar wants to merge 1 commit intomicrosoft:mainfrom
Open
.NET: Send A2A session task id as message taskId#5465karimbaidar wants to merge 1 commit intomicrosoft:mainfrom
karimbaidar wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Author
|
@moonbox3 can someone please review this PR ? thank you! |
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
Fixes #5417.
A2AAgentsessions can carry both acontextIdand ataskIdthroughCreateSessionAsync(contextId, taskId), but outbound messages were copying the session task id intoReferenceTaskIdsinstead ofTaskId. For an in-progress A2A task, the next client message needstaskIdset so the remote agent can update that task. With the current payload, callers cannot resume that task-specific interaction through the framework path.Description
Message.TaskIdfromA2AAgentSession.TaskId.ReferenceTaskIds.RunAsyncandRunStreamingAsyncregression tests to use the publicCreateSessionAsync(contextId, taskId)path and assert that bothcontextIdandtaskIdare sent.This is safe because it uses the existing session task id and does not add a new public API or change the session serialization shape. It aligns the wire payload with the existing overload name and with the A2A task continuation field.
Validation
dotnet test --project tests/Microsoft.Agents.AI.A2A.UnitTests/Microsoft.Agents.AI.A2A.UnitTests.csproj(net8.0,net9.0,net10.0; 351 passed)dotnet format agent-framework-dotnet.slnx --verify-no-changes --no-restore --include src/Microsoft.Agents.AI.A2A/A2AAgent.cs tests/Microsoft.Agents.AI.A2A.UnitTests/A2AAgentTests.csgit diff --checkRemaining risk / follow-up
This does not add a separate public
ReferenceTaskIdssession API. If callers need to start a new task while explicitly referencing earlier tasks, that should be handled as a follow-up API discussion.Contribution Checklist