fix(samples): emit Task(TASK_STATE_SUBMITTED) as first streaming event#970
Merged
sokoliva merged 6 commits intoa2aproject:1.0-devfrom Apr 14, 2026
Merged
fix(samples): emit Task(TASK_STATE_SUBMITTED) as first streaming event#970sokoliva merged 6 commits intoa2aproject:1.0-devfrom
Task(TASK_STATE_SUBMITTED) as first streaming event#970sokoliva merged 6 commits intoa2aproject:1.0-devfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a README for the SDK samples and updates the sample agent and CLI client to better handle task streaming. Specifically, the agent now enqueues an initial task submission event, and the CLI processes streaming updates by extracting the task ID from the first event. Review feedback suggests expanding the CLI's initial event handling to include Message objects and ensuring the task ID is reset for all terminal task states, such as failures or cancellations, to maintain correct session state.
🧪 Code Coverage (vs
|
guglielmo-san
approved these changes
Apr 14, 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.
Description
Updates the sample agent and CLI to correctly follow the A2A streaming event contract, where the first event in a stream must be a
Taskor aMessageobject inTASK_STATE_SUBMITTEDstate.Changes
hello_world_agent.py
SampleAgentExecutor.execute()now enqueues aTask(TASK_STATE_SUBMITTED)object as its very first event, before any TaskUpdater calls. The initial user message is included in the Task's history field, since the consumer sets message_to_save = None upon receiving a Task event (expecting the task to carry the message itself).cli.py
Updates
_handle_streamto match the new event contract:The first event is now expected to be a
Messageor aTask(not an (event, task) tuple), and its id is used to initializecurrent_task_id.README.md
Adds a
README.mdfor the samples.Tested
Related issue #965 🦕
BEGIN_COMMIT_OVERRIDE
chore(samples): emit
Task(TASK_STATE_SUBMITTED)as first streaming event (#970)END_COMMIT_OVERRIDE