Surface Status.Message text from non-streaming A2A task responses#552
Open
PratikDhanave wants to merge 1 commit into
Open
Surface Status.Message text from non-streaming A2A task responses#552PratikDhanave wants to merge 1 commit into
PratikDhanave wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves response fidelity and usage accounting in provider implementations: it makes non-streaming A2A task responses surface Status.Message text (matching the streaming path), and it extends Gemini usage mapping to include reasoning/thought token counts.
Changes:
- A2A provider: in non-streaming
*a2a.Taskresponses, extractStatus.Messageparts forInputRequiredand terminal task states and propagate theMessageID. - A2A provider: add a regression test covering an
InputRequiredtask whose response is carried only inStatus.Message. - Gemini provider: map
thoughtsTokenCounttoUsageDetails.ReasoningTokenCountand add a test to verify the mapping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| provider/geminiprovider/agent.go | Adds Gemini usage mapping for reasoning/thought token counts. |
| provider/geminiprovider/agent_test.go | Adds coverage ensuring thoughtsTokenCount is surfaced as ReasoningTokenCount. |
| provider/a2aprovider/a2a.go | Updates non-streaming task handling to include Status.Message content and message ID for input-required/terminal states. |
| provider/a2aprovider/a2a_test.go | Adds regression test verifying Status.Message text is returned for non-streaming input-required tasks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yieldTask, which handles the *a2a.Task object path used by non-streaming SendMessage and the GetTask continuation, built its ResponseUpdate only from task.Artifacts and ignored task.Status.Message. When an A2A server returns a Task in an input-required or terminal state that carries its text in Status.Message with no artifacts (e.g. a follow-up question), the text was silently dropped. The streaming TaskStatusUpdateEvent path already extracts Status.Message for these states. Mirror that in yieldTask so the streaming and non-streaming paths agree.
PratikDhanave
force-pushed
the
fix-a2a-nonstreaming-status-message
branch
from
July 22, 2026 04:07
83ddec6 to
97125b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The streaming path already extracts
Status.Messagetext for input-required and terminal task states — added deliberately (TestRunStreamingWithTaskStatusUpdateEvent_WithMessage, mirroring .NET microsoft/agent-framework#6043):But
yieldTask— the*a2a.Taskobject path used by non-streamingSendMessageand theGetTaskcontinuation — built its update only fromtask.Artifactsand never readtask.Status.Message:Per the A2A spec a server may return a
Task(not aMessage) fromSendMessage/GetTask, andTaskStatus.Messageis the natural place for an input-required follow-up question or a terminal summary when there are no artifacts. In that case the non-streaming caller got an update with empty contents — the agent’s question was silently lost — while the exact same logical response over streaming surfaced it. A pure streaming-vs-non-streaming parity gap.Fix
Mirror the streaming branch in
yieldTask: set the message ID fromStatus.Messageand, for input-required/terminal states, extract its parts before appending any artifact contents.Test
TestRunWithInputRequiredTaskMessagereturns a non-streaming*a2a.TaskinInputRequiredstate whoseStatus.Messageholds a question and no artifacts, then asserts the response text equals the question. It fails on the old code (empty) and passes with the fix. Full package tests remain green (no existing*a2a.Tasktest exercisedStatus.Message).