Skip to content

[dotnet-port] Populate MessageID from TaskStatusUpdateEvent.Status.Message in A2A agent - #215

Merged
gdams merged 1 commit into
mainfrom
dotnet-port-a2a-messageid-fix-abc9b60e-f053653b0253c814
May 26, 2026
Merged

[dotnet-port] Populate MessageID from TaskStatusUpdateEvent.Status.Message in A2A agent#215
gdams merged 1 commit into
mainfrom
dotnet-port-a2a-messageid-fix-abc9b60e-f053653b0253c814

Conversation

@qmuntal

@qmuntal qmuntal commented May 25, 2026

Copy link
Copy Markdown
Member

When the Go A2A agent receives a TaskStatusUpdateEvent during streaming, ResponseUpdate.MessageID is now set from Status.Message.ID when the message is present, falling back to the TaskID otherwise.

This aligns with the .NET fix in microsoft/agent-framework#6043.

When the Go A2A agent receives a TaskStatusUpdateEvent during streaming,
ResponseUpdate.MessageID is now set from Status.Message.ID when the
message is present, falling back to the TaskID otherwise.

This aligns with the .NET fix in microsoft/agent-framework#6043.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 06:10
@qmuntal
qmuntal requested a review from a team as a code owner May 25, 2026 06:10

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

Updates the Go A2A agent’s streaming handling so ResponseUpdate.MessageID is derived from the status update’s embedded message (TaskStatusUpdateEvent.Status.Message.ID) when available, matching the behavior of the referenced .NET fix and improving message correlation during streaming.

Changes:

  • Populate ResponseUpdate.MessageID from TaskStatusUpdateEvent.Status.Message.ID when present; otherwise keep the TaskID fallback.
  • Add a streaming unit test covering the “status update contains a message” scenario to validate the new MessageID behavior.
Show a summary per file
File Description
agent/provider/a2aagent/a2a.go Adjusts streaming status-update mapping to prefer Status.Message.ID for MessageID with TaskID fallback.
agent/provider/a2aagent/a2a_test.go Adds a test ensuring MessageID is sourced from Status.Message.ID when provided.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions

Copy link
Copy Markdown
Contributor

Cross-Repo Parity Review ✅

This PR is a direct port of the .NET fix from microsoft/agent-framework#6043 and is semantically aligned with the upstream fix.

What was fixed in .NET:
ConvertToAgentResponseUpdate(TaskStatusUpdateEvent) added MessageId = statusUpdateEvent.Status.Message?.MessageId, falling back to TaskId otherwise.

What this PR does in Go:
Sets messageID = e.Status.Message.ID when e.Status.Message != nil, falling back to string(e.TaskID) — an idiomatic Go equivalent of the C# null-conditional operator.

Both implementations are semantically identical. The test coverage mirrors the .NET approach (cases with and without a message in the status update).

No parity issues found.

Generated by Go API Consistency Review Agent for issue #215 · ● 5.3M ·

@gdams
gdams merged commit 134476f into main May 26, 2026
17 checks passed
@gdams
gdams deleted the dotnet-port-a2a-messageid-fix-abc9b60e-f053653b0253c814 branch May 26, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port] Populate MessageID from TaskStatusUpdateEvent.Status.Message in A2A agent

3 participants