Repository navigation
Python: [Bug]: Terminal A2A Task snapshots omit status messages #8998
Description
Description
A terminal A2A Task snapshot with content in status.message drops that content in A2AAgent.run() and poll_task(). The terminal TaskStatusUpdateEvent path already surfaces the same status content. This can hide a failure explanation, including the kind of message emitted by the repository A2A hosting sample.
Expected: The failure note is available in the response, as it is for a terminal status-update event. Artifacts remain the protocol channel for task outputs.
Actual: The response text is empty although the terminal Task contains Agent execution failed..
Code Sample
This uses a mocked provider/client and makes no service request.
import asyncio
from unittest.mock import AsyncMock, MagicMock
from a2a.types import Message, Part, Role, Task, TaskState, TaskStatus
from agent_framework_a2a import A2AAgent, A2AContinuationToken
async def main():
task = Task(
id="example-task",
context_id="example-context",
status=TaskStatus(
state=TaskState.TASK_STATE_FAILED,
message=Message(
message_id="failure-note",
role=Role.ROLE_AGENT,
parts=[Part(text="Agent execution failed.")],
),
),
)
client = MagicMock()
client.get_task = AsyncMock(return_value=task)
agent = A2AAgent(client=client, http_client=None)
response = await agent.poll_task(A2AContinuationToken(task_id=task.id, context_id=task.context_id))
print(repr(response.text))
assert response.text == "Agent execution failed."
asyncio.run(main())Package Versions
Source checkout e9857bd75a21843803431a2e7dfa41ee9b017ac7: agent-framework-core 1.20.0, agent-framework-a2a 1.0.0b261002; A2A SDK 1.2.1.
Python Version
Python 3.12.12.
Additional Context
I will submit a focused fix with regression coverage for this behavior.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
github-actions commentedon Oct 3, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The bug reproduces in
python/packages/a2a/agent_framework_a2a/_agent.py::_updates_from_taskwhen a terminal Task has content only instatus.message; bothA2Agent.run()andpoll_task()produce an empty response. Minimal repro: provide a mocked failed Task whose status message containsAgent execution failed., invoke either route, and assert thatresponse.textpreserves the message.python/packages/a2a/tests/test_a2a_agent.py1.0.0b2610021.0.0b261002eavanvalkenburg commentedon Oct 27, 2026
/plan Investigate the smallest backward-compatible fix through existing PR #8999 by quifox (@quifox), not a competing implementation. Current main terminal Task snapshots parse artifacts/history but omit status.message, whereas terminal status events expose it; a failure-only snapshot can therefore lose its explanation. Keep artifacts as task outputs and define supplemental status-message ordering/identity without duplicating history, standalone messages, repeated snapshots or status events. Reuse shared conversion/finalization helpers before adding parallel tracking abstractions; distinguish real final-response duplication from temporary metadata-only updates removed by finalization, and preserve task/message metadata. Compare current main rather than old patch snippets: terminal/background _operation_state and continuation clearing must survive every return path, including empty or fully deduplicated output, in both run modes and poll_task. Candidate PR touches more than a trivial boundary, so report a conservative production-code scope and meaningful compatibility choices before readiness. Reuse its existing tests and review evidence, then identify missing regressions for failed/completed/cancelled snapshots, status/history/artifact identity overlap, event-before-snapshot and reverse ordering, repeated tasks, metadata-only terminal updates and final continuation state. Coordinate with existing owner Eduard van Valkenburg (@eavanvalkenburg) and preserve #9051 closed state. No assignment, ready label, PR approval or reopening is implied.