Python: fix A2A status message ids#5960
Open
he-yufeng wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes A2A status message IDs not being preserved when streaming events are converted to AgentResponseUpdate, so downstream consumers can correlate updates to their originating A2A message.
Changes:
- Propagate
message_idfromTaskStatus.messagein_updates_from_task. - Propagate
message_idfromTaskStatusUpdateEvent.status.messagein_updates_from_task_update_event. - Add regression tests asserting
message_idis preserved on streaming updates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/packages/a2a/agent_framework_a2a/_agent.py | Forwards the A2A message ID to AgentResponseUpdate in both task and status-update conversion paths. |
| python/packages/a2a/tests/test_a2a_agent.py | Updates existing test to use an explicit message ID and adds assertions verifying message_id propagation. |
| contents=contents, | ||
| role="assistant" if status.message.role == A2ARole.ROLE_AGENT else "user", | ||
| response_id=task.id, | ||
| message_id=status.message.message_id or None, |
9387a33 to
625d2ea
Compare
Contributor
Author
|
Updated to address the inline comment and rebased on current main. Local validation: targeted A2A tests for the affected streaming paths passed, plus ruff check/format, py_compile, and git diff --check. |
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
TaskStatusUpdateEventis converted toAgentResponseUpdateTaskpayloadsFixes #5949.
Validation
uv run pytest tests\test_a2a_agent.py -q -k "streaming_working_update_user_role_mapping or streaming_status_update_event_yields_content"uv run ruff check agent_framework_a2a\_agent.py tests\test_a2a_agent.pyuv run ruff format --check agent_framework_a2a\_agent.py tests\test_a2a_agent.pypython -m py_compile python\packages\a2a\agent_framework_a2a\_agent.py python\packages\a2a\tests\test_a2a_agent.pygit diff --check upstream/main..HEAD