fix(task): CancelTask now actually stops running task execution#113
fix(task): CancelTask now actually stops running task execution#113
Conversation
Resolves issue #112 where CancelTask only updated database state but didn't stop the actual running task execution. Key Changes: - Added runningTasks map to DefaultTaskManager to track cancel functions - CancelTask() now calls actual context cancel functions to stop execution - Updated both background and streaming task handlers to use cancellable contexts - Added proper cleanup when tasks complete, fail, or are cancelled - Added comprehensive tests to verify cancellation works correctly This ensures that when a client calls tasks/cancel, the task execution actually stops immediately instead of continuing to run in the background. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude CI is failing. |
|
Claude finished @edenreich's task —— View job CI Investigation & Fix Tasks
Issues Fixed ✅The CI failures were caused by formatting issues in the code that were caught by the "Check dirty" step:
Both issues have been fixed and committed. The local linting ( SummaryAll formatting issues that caused the CI failure have been resolved. The next CI run should pass successfully. |
- Fix trailing whitespace in server/task_manager.go lines 278 and 317 - Add missing newline at end of server/task_cancellation_test.go 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude CI is still failing - please fix. Also please remove all inline comments inside of the functions bodies. |
|
Claude finished @edenreich's task —— View job CI Investigation & Fix Tasks ✅
Issues Fixed ✅
SummaryAll formatting issues that caused the CI failure have been resolved and all inline comments have been removed from function bodies as requested. The fix has been committed to the PR branch with commit 41bf458. Local linting ( |
- Remove all inline comments from function bodies as requested - Fix missing newline at end of task_cancellation_test.go file - All linting and tests pass successfully Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
|
@claude Please fix the CI: |
|
Claude finished @edenreich's task —— View job Claude finished @edenreich's task —— View job CI Fix Tasks ✅
Issue Fixed ✅The CI failure was caused by a missing newline at the end of Local linting ( |
Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…anager Signed-off-by: Eden Reich <eden.reich@gmail.com>
|
🎉 This PR is included in version 0.15.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes #112
This PR resolves the critical bug where
CancelTaskAPI endpoint only updated task state in the database but did not actually stop the running task execution.Problem
Tasks continued to run in the background until completion, even though the task state showed "cancelled". This led to:
Solution
runningTasks map[string]context.CancelFuncto track active tasksCancelTask()now calls actual context cancel functions to stop executionTesting
🤖 Generated with Claude Code