You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A2aAgentExecutor.cancel() method raise NotImplementedError, making the CancelTask A2A protocol method non-functional in ADK. #4127
A2aAgentExecutor.cancel() method raise NotImplementedError, making the CancelTask A2A protocol method non-functional in ADK.
Root Cause
The cancel method was defined as an abstract method in the a2a-sdk's AgentExecutor base class but was not implemented in ADK's A2aAgentExecutor. Any attempt to cancel a task would fail immediately.
Impact
-CancelTask RPC method is completely non-functional
-Tasks cannot be canceled through the A2A protocol
-Clients attempting to cancel tasks will receive errors
-No cooperative cancellation workflow is available
As a temporary workaround, you can monkey-patch the method to enqueue a TaskStatusUpdateEvent with TaskState.canceled and final=True to the event queue.
We're tracking the PR for merge — once it lands this should work out of the box.
thanks for flagging this, fixed in v2.6.0, A2aAgentExecutor.cancel now publishes a terminal canceled status update instead of raising, so tasks/cancel reaches the canceled state.
Activity
ryleymao commentedon Jan 12, 2026
If anyone is actively working on this already, please let me know. Otherwise I’ll proceed and open a PR shortly.
fix(a2a): Implement A2aAgentExecutor.cancel() method
surajksharma07 commentedon Feb 16, 2026
@secprog
cancel()ina2a_agent_executor.py:119just raisesNotImplementedError.PR #4161 by @ryleymao already has a fix for this.
As a temporary workaround, you can monkey-patch the method to enqueue a
TaskStatusUpdateEventwithTaskState.canceledandfinal=Trueto the event queue.We're tracking the PR for merge — once it lands this should work out of the box.
Team is looking more into it.
surajksharma07 commentedon Mar 26, 2026
@seanzhou1023 Please have a look into it once.
GWeale commentedon Aug 6, 2026
thanks for flagging this, fixed in v2.6.0, A2aAgentExecutor.cancel now publishes a terminal canceled status update instead of raising, so tasks/cancel reaches the canceled state.