Fix A2A protocol chunk streaming and task completion states#1113
Merged
copybara-service[bot] merged 1 commit intogoogle:mainfrom Apr 8, 2026
Merged
Conversation
56ac1c8 to
16d38c3
Compare
sherryfox
approved these changes
Apr 8, 2026
16d38c3 to
c6017e6
Compare
c6017e6 to
74fd328
Compare
This PR fixes issues where A2A endpoints would prematurely truncate streams or drop events during conversational handoffs. * Stream Persistence: RemoteA2AAgent no longer aborts streams prematurely on HTTP endpoints. It now properly waits for the formal TaskState.COMPLETED status update. * Artifact Chunking: Fixed flag assignments in AgentExecutor so the first chunk reliably sends append=false and lastChunk cleanly mimics the generated partial state. * Protocol Alignment: Removed the Message payload in the final success event to perfectly reflect the Go A2A reference implementation.
74fd328 to
c95f669
Compare
sherryfox
approved these changes
Apr 8, 2026
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.
Summary
This PR fixes issues where A2A endpoints would prematurely truncate streams or drop events during conversational handoffs.
Key Changes
RemoteA2AAgentno longer aborts streams prematurely on HTTP endpoints. It now properly waits for the formalTaskState.COMPLETEDstatus update.AgentExecutorso the first chunk reliably sendsappend=falseandlastChunkcleanly mimics the generatedpartialstate.Messagepayload in the final success event to perfectly reflect the Go A2A reference implementation.Testing: Validated against the
a2a_serverwith thea2a_basicclient, fully restoring end-to-end multi-agent evaluation output natively. All unit tests succeed.