Skip to content

A2aAgentExecutor.cancel() method raise NotImplementedError, making the CancelTask A2A protocol method non-functional in ADK. #4127

Closed

Description

@secprog

Describe the bug

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

Expected behavior

Be able to cancel an a2a task

Activity

  1. added
    a2a[Component] This issue is related a2a support inside ADK.
    on Jan 12, 2026
  2. added theissue type on Jan 12, 2026
  3. self-assigned this
    on Jan 12, 2026
  4. ryleymao commented on Jan 12, 2026

    @ryleymao

    If anyone is actively working on this already, please let me know. Otherwise I’ll proceed and open a PR shortly.

  5. added a commit that references this issue on Jan 14, 2026
    898166a
  6. surajksharma07 commented on Feb 16, 2026

    @surajksharma07
    Collaborator

    @secprog cancel() in a2a_agent_executor.py:119 just raises NotImplementedError.

    PR #4161 by @ryleymao already has a fix for this.

    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.

    Team is looking more into it.

  7. added
    answered[Status] This issue has been answered by the maintainer
    on Feb 16, 2026
  8. surajksharma07 commented on Mar 26, 2026

    @surajksharma07
    Collaborator

    @seanzhou1023 Please have a look into it once.

  9. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    and removed
    answered[Status] This issue has been answered by the maintainer
    on Apr 16, 2026
  10. GWeale commented on Aug 6, 2026

    @GWeale
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

a2a[Component] This issue is related a2a support inside ADK.needs review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions