feat: Add optional referenceTaskIds for task followups#608
Merged
Conversation
pstephengoogle
approved these changes
May 20, 2025
holtskinner
added a commit
that referenced
this pull request
May 27, 2025
🤖 I have created a release *beep* *boop* --- ## [0.2.1](v0.2.0...v0.2.1) (2025-05-27) ### Features * Add a new boolean for supporting authenticated extended cards ([#618](#618)) ([e0a3070](e0a3070)) * Add optional referenceTaskIds for task followups ([#608](#608)) ([5368e77](5368e77)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Holt Skinner <holtskinner@google.com>
debug313
pushed a commit
to debug313/agent-to-agent
that referenced
this pull request
Apr 12, 2026
🤖 I have created a release *beep* *boop* --- ## [0.2.1](a2aproject/A2A@v0.2.0...v0.2.1) (2025-05-27) ### Features * Add a new boolean for supporting authenticated extended cards ([#618](a2aproject/A2A#618)) ([a00a1f7](a2aproject/A2A@a00a1f7)) * Add optional referenceTaskIds for task followups ([#608](a2aproject/A2A#608)) ([4cc9e48](a2aproject/A2A@4cc9e48)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Holt Skinner <holtskinner@google.com>
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.
Problem
Clients need to follow up or refine previously created tasks by agents.
Proposal
Option 1: Restartable Tasks
Agents allow tasks to restart processing from terminal states (Completed, Failed and Cancelled).
This option focuses on reusing existing tasks by restarting them when a follow-up or refinement is requested. This simplifies agent development by maintaining local context and referencing previous tasks directly. However, it introduces complexities with parallel follow-ups, task immutability, and bookkeeping. It can also lead to inconsistencies between the client and agent's view of task history and requires the agent to manage refined artifacts and inputs.
Option 2: New Task in same contextId (Preferred)
Context can be thought of as a larger goal from a client perspective. Clients can use the same contextId from the previous task and send a message for refinement or followup. Agents should spawn up new tasks. Tasks cannot restart processing from terminal states (Completed, Failed and Cancelled).
This approach favors creating new tasks for each follow-up or refinement while using the same
contextId. This simplifies implementation for agents, enables parallel processing, and maintains task immutability. Clients can keep references to tasks with their state, artifacts, and messages. However, agents need to implement a strategy to infer previous tasks based on thecontextIdand handle potential ambiguities.Other Aspects
Task Referencing
contextId. They may use strategies like RAG (Retrieval-Augmented Generation) to retrieve relevant tasks, messages, and artifacts.referenceTaskIdsin the Message object to explicitly reference previous tasks. This acts as a hint to the serving agent.Artifact Referencing
input-required. Clients can then pass on the artifact inputs asPartsin the message.referenceArtifactIdin thepart'smetadata.Artifact Mutation Tracking
input-requiredto explicitly request the client to specify which artifact to work with.Proposed API Change
referenceTaskIdsfield in theMessageobject.referenceArtifactIdinpartmetadata ofMessageobject.