Python: [A2A] Set message_id on AgentResponseUpdate for message-bearing paths#6163
Merged
Merged
Conversation
…ng paths Map A2A protocol message_id to AgentResponseUpdate.message_id in two paths where it was previously omitted, aligning with .NET behavior: 1. Standalone A2AMessage: set message_id=msg.message_id (matches .NET ConvertToAgentResponseUpdate(Message) which sets both ResponseId and MessageId to message.MessageId) 2. TaskStatusUpdateEvent (terminal/input_required): set message_id=message.message_id (matches .NET which sets MessageId=statusUpdateEvent.Status.Message?.MessageId) Fixes microsoft#5949 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Maps A2A protocol message_id to AgentResponseUpdate.message_id in two paths (standalone A2AMessage and TaskStatusUpdateEvent terminal/input_required) where it was previously dropped, aligning Python behavior with .NET and fixing #5949.
Changes:
- Set
message_id=msg.message_idon the standalone A2AMessage path in_map_a2a_stream. - Set
message_id=message.message_idon theTaskStatusUpdateEventpath in_updates_from_task_update_event. - Updated tests to assert
message_idis propagated.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/a2a/agent_framework_a2a/_agent.py | Propagate A2A message_id to AgentResponseUpdate.message_id in the two affected paths. |
| python/packages/a2a/tests/test_a2a_agent.py | Assert message_id on updates and use deterministic ids for affected tests. |
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
giles17
commented
May 28, 2026
Contributor
Author
giles17
left a comment
There was a problem hiding this comment.
Automated Code Review
Reviewers: 3 | Confidence: 92% | Result: All clear
Reviewed: Correctness, Security Reliability, Test Coverage
Automated review by giles17's agents
eavanvalkenburg
approved these changes
May 29, 2026
moonbox3
approved these changes
May 29, 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.
Summary
Maps A2A protocol
message_idtoAgentResponseUpdate.message_idin two paths where it was previously omitted, aligning Python behavior with .NET:Standalone A2AMessage: set
message_id=msg.message_id(matches .NETConvertToAgentResponseUpdate(Message)which sets bothResponseIdandMessageIdtomessage.MessageId)TaskStatusUpdateEvent (terminal/input_required): set
message_id=message.message_id(matches .NET which setsMessageId=statusUpdateEvent.Status.Message?.MessageId)Motivation
Issue #5949 reported that
task_idis correctly mapped toresponse_id, butmessage_idfrom A2A protocol messages is discarded. The .NET side already correctly setsMessageIdin both of these paths.The semantic mapping is:
task_id→response_id(identifies the conversation round)message_id/artifact_id→message_id(identifies the individual content piece)Changes
_agent.py: Addedmessage_id=msg.message_idto the standaloneA2AMessagepath_agent.py: Addedmessage_id=message.message_idto theTaskStatusUpdateEventpathtest_a2a_agent.py: Updated tests to assertmessage_idis correctly setTesting
All 103 tests in
test_a2a_agent.pypass.Fixes #5949