feat(worker): implement task cancellation with AbortController (#174) #220

Merged
jack merged 7 commits from feat/174-task-cancellation into main 2026-01-24 17:56:08 +00:00
Owner

Summary

Implements proper task cancellation using AbortController, allowing running tasks to be gracefully cancelled.

Changes:

  • Add currentAbortController field to WorkerService
  • Create AbortController when task starts, call abort() on cancellation
  • Pass AbortSignal to processTask and all handlers
  • Add signal parameter to all task handlers
  • Add signal to AgentQueryOptions interface for AI providers
  • Check for cancellation before processing starts

Closes #174

Test Plan

  • Verify task cancellation stops running task
  • Verify cancelled tasks don't report errors
  • Verify AbortSignal is passed through to agent queries

🤖 Generated with Claude Code

## Summary Implements proper task cancellation using AbortController, allowing running tasks to be gracefully cancelled. Changes: - Add `currentAbortController` field to `WorkerService` - Create `AbortController` when task starts, call `abort()` on cancellation - Pass `AbortSignal` to `processTask` and all handlers - Add `signal` parameter to all task handlers - Add `signal` to `AgentQueryOptions` interface for AI providers - Check for cancellation before processing starts Closes #174 ## Test Plan - [ ] Verify task cancellation stops running task - [ ] Verify cancelled tasks don't report errors - [ ] Verify AbortSignal is passed through to agent queries 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(worker): implement task cancellation with AbortController (#174)
All checks were successful
CI / build (pull_request) Successful in 41s
90a3902e1a
- Add currentAbortController field to WorkerService
- Create AbortController when task starts, abort on cancellation
- Pass AbortSignal to processTask and all handlers
- Add signal parameter to all task handlers:
  - observation-handler
  - summarize-handler
  - embedding-handler
  - qdrant-handler
  - context-handler
  - claudemd-handler
- Add signal to AgentQueryOptions interface
- Check for cancellation before processing

Closes #174

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m13s
76d0df2efb
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m7s
0c0b0a0069
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m16s
3c3ee5437b
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m12s
2e66a1d821
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m16s
aacf5e7b11
Merge branch 'main' into feat/174-task-cancellation
All checks were successful
CI / build (pull_request) Successful in 1m17s
dec01a6269
jack merged commit 5048c5e6e0 into main 2026-01-24 17:56:08 +00:00
Sign in to join this conversation.
No description provided.