Skip to content

Python: [Bug]: Terminal A2A Task snapshots omit status messages #8998

Description

@quifox

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.

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 3, 2026
  2. added
    reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow
    on Oct 3, 2026
  3. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

    🤖 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_task when a terminal Task has content only in status.message; both A2Agent.run() and poll_task() produce an empty response. Minimal repro: provide a mocked failed Task whose status message contains Agent execution failed., invoke either route, and assert that response.text preserves the message.

    • Failing test: python/packages/a2a/tests/test_a2a_agent.py
    • Files examined: python/packages/a2a/agent_framework_a2a/_agent.py, python/packages/a2a/tests/test_a2a_agent.py, python/packages/a2a/pyproject.toml
    • Tests run: test_poll_task_completed, test_streaming_status_update_event_yields_content, test_terminal_task_failed_surfaces_status_message[run], test_terminal_task_failed_surfaces_status_message[poll]
    • Reported version: 1.0.0b261002
    • Current version: 1.0.0b261002
  4. added
    a2aUsage: [Issues, PRs], Target: A2A
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 3, 2026
  5. eavanvalkenburg commented on Oct 27, 2026

    @eavanvalkenburg
    Member

    /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.

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

Metadata

Metadata

Labels

a2aUsage: [Issues, PRs], Target: A2ApythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions