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
fix: handle concurrent task completion during cancellation (#449)
### Description
We
[check](https://github.com/a2aproject/a2a-python/blob/d2e869f/src/a2a/server/request_handlers/default_request_handler.py#L149)
that a Task is in a cancellable state before calling
`agent_executor.cancel`.
This doesn't guarantee there's no task completion event in the queue
which will be applied before our task cancellation request gets handled.
This PR adds an extra check to ensure that we don't return a Task in a
non-cancelled state as a successful cancellation call response. Instead
we raise `TaskNotCancelableError`.
0 commit comments