Skip to content

Python: propagate A2A status message ids - #5993

Closed
Yufeng He (he-yufeng) wants to merge 2 commits into
microsoft:mainfrom
he-yufeng:fix/a2a-message-id-updates
Closed

Python: propagate A2A status message ids#5993
Yufeng He (he-yufeng) wants to merge 2 commits 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
@moonbox3 Evan Mattson (moonbox3) added the python Usage: [Issues, PRs], Target: Python label May 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@moonbox3

Evan Mattson (moonbox3) commented May 26, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/a2a/agent_framework_a2a
   _agent.py2861993%176, 184, 378, 383, 385, 429–430, 584, 600, 608, 629, 650, 678, 694, 704, 715, 722–723, 764
TOTAL36376431488% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
7255 34 💤 0 ❌ 0 🔥 1m 55s ⏱️

@giles17 Giles Odigwe (giles17) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 4 | Confidence: 94% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach


Automated review by giles17's agents

@giles17

Copy link
Copy Markdown
Contributor

Closing in favor of #6053

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

Labels

python Usage: [Issues, PRs], Target: Python

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

4 participants