Skip to content

Python: Retain terminal A2A Task status messages - #8999

Open
quifox (quifox) wants to merge 2 commits into
microsoft:mainfrom
quifox:fix/terminal-a2a-status-messages
Open

quifox (quifox) wants to merge 2 commits into
microsoft:mainfrom
quifox:fix/terminal-a2a-status-messages

Conversation

@quifox

@quifox quifox (quifox) commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & Context

Terminal A2A Tasks can carry a final status note or failure explanation in status.message, which is omitted from run() and poll_task() responses.

Description & Review Guide

  • What are the major changes? Include terminal status messages after the selected artifacts or history, and deduplicate non-empty protocol message IDs within each task and run. Duplicate updates reset merge_mode while retaining metadata and terminal state, so aggregation preserves the already-emitted response.
  • What is the impact of these changes? Retains useful terminal information and prevents repeated message content. Existing artifact selection, input-required behavior, public APIs, and dependencies remain compatible.
  • What do you want reviewers to focus on? Message identity, metadata preservation, and terminal continuation clearing across streaming, non-streaming, and polling paths. Artifact IDs remain separate. Empty message IDs do not participate in deduplication. When history and status in the same Task share an ID, the history representation takes precedence.

Related Issue

Fixes #8998

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Implementation, regression tests, and this description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible (A2A: 304 passed, 96.20% coverage. Core: 9,646 passed, 25 skipped, 2 xfailed. Integration tests and other package suites were not run.)
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR.
  • This is not a breaking change.

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.

Copilot review overview

🟡 Changes recommended

Metadata-only duplicate updates can create an extra empty message when another task message intervenes.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Retains terminal A2A task status messages while deduplicating protocol messages and preserving metadata.

Changes:

  • Converts terminal status.message values into response updates.
  • Deduplicates messages by non-empty ID per task and run.
  • Adds regression coverage for terminal states, ordering, metadata, and artifacts.
File Description
python/​packages/​a2a/​agent_framework_a2a/​_agent.py Adds status-message conversion and deduplication.
python/​packages/​a2a/​tests/​test_a2a_agent.py Adds terminal-message regression tests.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
github-app-auth — d46b9a2e Deployed Nov 12, 2026 by quifox via add_label #27653
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]: Terminal A2A Task snapshots omit status messages

3 participants