Add the cancelation functions for the AgentTasks.