Skip to content

Conversation

@edenreich
Copy link
Contributor

Fix bug where A2A task cancellation didn't work properly. The issue was that CancelBackgroundTask() was using a stale copy of TaskPollingState from GetBackgroundTasks() instead of getting the live polling state from the task tracker.

This caused:

  1. Tasks to disappear from the UI task list (cleanup was called)
  2. But the actual background polling goroutine continued running
  3. A2A server never received the cancellation request

The fix gets the live polling state directly from taskTracker.GetPollingState() which ensures the correct CancelFunc is called to stop the active goroutine.

Fixes #195

Generated with Claude Code

Fix bug where A2A task cancellation didn't work properly. The issue was that
CancelBackgroundTask() was using a stale copy of TaskPollingState from
GetBackgroundTasks() instead of getting the live polling state from the
task tracker. This caused:

1. Tasks to disappear from the UI task list (cleanup was called)  
2. But the actual background polling goroutine continued running
3. A2A server never received the cancellation request

The fix gets the live polling state directly from taskTracker.GetPollingState()
which ensures the correct CancelFunc is called to stop the active goroutine.

Fixes #195

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] A2A Tasks cancellation didn't work

2 participants