Skip to content

Python: propagate A2A status message ids#5993

Open
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/a2a-message-id-updates
Open

Python: propagate A2A status message ids#5993
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/a2a-message-id-updates

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Fixes #5949.

A2A status updates already map the A2A task id to AgentResponseUpdate.response_id, but the status message id was not carried into AgentResponseUpdate.message_id. This keeps that mapping for both streamed TaskStatusUpdateEvent messages and in-progress task status messages.

To verify

  • uv run --frozen pytest tests\test_a2a_agent.py -q from python/packages/a2a
  • uv run --frozen ruff check agent_framework_a2a_agent.py tests\test_a2a_agent.py from python/packages/a2a
  • uv run --frozen ruff format --check agent_framework_a2a_agent.py tests\test_a2a_agent.py from python/packages/a2a
  • python -m py_compile python\packages\a2a\agent_framework_a2a_agent.py python\packages\a2a\tests\test_a2a_agent.py
  • git diff --check

Copilot AI review requested due to automatic review settings May 21, 2026 06:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the A2A→Agent Framework identifier mapping for status updates by propagating A2A message_id into AgentResponseUpdate.message_id (in addition to the existing mapping of A2A task_idAgentResponseUpdate.response_id). This applies to both streamed TaskStatusUpdateEvent messages and in-progress task status messages surfaced during streaming.

Changes:

  • Populate AgentResponseUpdate.message_id for in-progress task status messages emitted via _updates_from_task.
  • Populate AgentResponseUpdate.message_id for streamed TaskStatusUpdateEvent updates emitted via _updates_from_task_update_event.
  • Extend tests to assert the correct message_id propagation for both paths.

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 Adds propagation of A2A status message_id into AgentResponseUpdate.message_id for task/status streaming updates.
python/packages/a2a/tests/test_a2a_agent.py Updates mocks and assertions to validate message_id propagation for in-progress and status-update-event streaming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: [A2A] Correctly Handle task_id and message_id Returned by A2A

3 participants