Python: fix A2A status message ids#5960
Conversation
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
|
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. |
0928516 to
4507db9
Compare
4507db9 to
042c4c7
Compare
|
Rebased onto current main; no code changes beyond the rebase.\n\nValidation on Windows:\n- .\.venv\Scripts\python.exe -m pytest packages\a2a\tests\test_a2a_agent.py -q -> 88 passed, 2 existing experimental warnings\n- .\.venv\Scripts\python.exe -m ruff check packages\a2a\agent_framework_a2a\_agent.py packages\a2a\tests\test_a2a_agent.py\n- .\.venv\Scripts\python.exe -m py_compile packages\a2a\agent_framework_a2a\_agent.py packages\a2a\tests\test_a2a_agent.py\n- git diff --check upstream/main..HEAD |
|
Closing in favor of #6053 |
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