Skip to content

.NET: Preserve A2A task status messages in agent responses - #9534

Merged
SergeyMenshykh merged 3 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-a2a-plan-review
Oct 20, 2026
Merged

SergeyMenshykh merged 3 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-a2a-plan-review

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation & Context

Optional A2A task-status messages were discarded unless the task required input, hiding failure explanations and other messages that require attention.

Description

  • Include available status messages for InputRequired, AuthRequired, Failed, Canceled, Rejected, and Unspecified.
  • Use the same conversion for ordinary task responses, streamed task snapshots, and streamed status updates.
  • Preserve artifacts, metadata, raw representations, and continuation behavior.
  • Add regression coverage for unsuccessful task responses and status-message conversion.

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: Copilot assisted with the implementation, regression tests, and PR description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Include status-message content for unsuccessful, interrupted, and unspecified tasks in ordinary and streaming responses. Preserve artifacts and continuation behavior, and add regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5855f4d-414c-4f06-a89d-8fcbaf0e77db
Copilot AI balanced review requested due to automatic review settings October 19, 2026 12:40
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth October 19, 2026 12:40 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth October 19, 2026 12:40 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Oct 19, 2026
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth October 19, 2026 12:41 — with GitHub Actions Active

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.

🟢 Approval recommended

The focused conversion changes are consistent across response paths, with regression coverage and no unresolved findings.

No open issues 🎉

What changed in this PR

Preserves important A2A task-status messages in .NET agent responses instead of discarding failure explanations and other actionable content.

Changes:

  • Applies shared status-message conversion across ordinary and streaming responses.
  • Continues omitting routine progress and successful-completion messages.
  • Adds regression coverage for status filtering, artifacts, and continuation behavior.
File Description
dotnet/​tests/​Microsoft.Agents.AI.A2A.UnitTests/​Extensions/​AgentTaskStatusExtensionsTests.cs Tests status filtering and content preservation.
dotnet/​tests/​Microsoft.Agents.AI.A2A.UnitTests/​Extensions/​A2AAgentTaskExtensionsTests.cs Tests status messages alongside artifacts.
dotnet/​tests/​Microsoft.Agents.AI.A2A.UnitTests/​A2AAgentTests.cs Covers unsuccessful ordinary and streaming responses.
dotnet/​src/​Microsoft.Agents.AI.A2A/​Extensions/​AgentTaskStatusExtensions.cs Expands eligible status-message conversion.
dotnet/​src/​Microsoft.Agents.AI.A2A/​Extensions/​A2AAgentTaskExtensions.cs Uses shared conversion for task responses.
dotnet/​src/​Microsoft.Agents.AI.A2A/​A2AAgent.cs Uses shared conversion for streamed status updates.

Review effort: Balanced

@github-actions github-actions Bot 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.

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (1 commit(s)): db33fa99bffc
Model: gpt-5.6-sol

Overview

The review found 1 verified inline finding(s).

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AAgentTaskExtensions.cs

Comment thread dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AAgentTaskExtensions.cs Outdated
Preserve status message roles, IDs, metadata, and raw representations in task responses. Retain streaming envelope metadata and add regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f5855f4d-414c-4f06-a89d-8fcbaf0e77db
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f5855f4d-414c-4f06-a89d-8fcbaf0e77db
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth October 19, 2026 14:38 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Oct 20, 2026
Merged via the queue into microsoft:main with commit fa77467 Oct 20, 2026
32 checks passed
@SergeyMenshykh
SergeyMenshykh deleted the sergeymenshykh-a2a-plan-review branch October 20, 2026 10:42
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework Oct 20, 2026

This branch was successfully deployed

1 active deployment
github-app-auth — e4129f38 Deployed Oct 19, 2026 by SergeyMenshykh via add_label #25747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants