Repository navigation
fix(cli): make task cancel report unknown and finished tasks instead of claiming success - #4331
Merged
ruvnet merged 1 commit intoOct 21, 2026
Conversation
…of claiming success
Merged
ruvnet
added a commit
that referenced
this pull request
Oct 21, 2026
Patch release bundling two task-command correctness fixes: - task cancel: task_cancel claimed success (and printed "Previous status: undefined") for a task id that doesn't exist or is already completed/failed/cancelled, and overwrote a finished task's result with the cancel reason. It now returns previousStatus, refuses to touch a finished task, and the CLI exits 1 instead of printing "cancelled" for either case (#4331). - task status: the status box was titled "Task: undefined" for every task — the command read result.id, but task_status returns taskId, the field every other task tool uses (#4332). Validated: both PRs' new test files (task-cancel.test.ts, task-status-header.test.ts) pass (6/6), pnpm -r build clean, tsc --noEmit clean, audit-umbrella-version-lockstep and audit-leaf-versions-published both clean before publish. Co-authored-by: r <r@x>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ruflo task canceland thetask_cancelMCP tool have three related bugs:task_cancelreturns{ success: false, error: 'Task not found' }and doesn't throw. The CLI never checkssuccess, so it prints✓ Task task-missing cancelled/Previous status: undefinedand exits 0. Scripts and agents treat that as success.completed,failedorcancelledsets its status tocancelledand replacesresultandcompletedAtwith the cancel reason, so the completed task's result is lost.Previous status: undefined. The CLI printsresult.previousStatus, buttask_cancelnever returns that field, so this line is wrong even for a normal cancel.Fix
task_cancelreturnspreviousStatus. For a task that's already finished, it returnssuccess: falsewithTask is already <status>and leaves the record unchanged.task cancelcheckssuccess === falseand exits 1 withFailed to cancel task <id>: <error>. With--format jsonit prints the raw result instead.Cancelling a
pendingorin_progresstask works as before. The ruflo-console callers only cancel open tasks, so they aren't affected.Tests
__tests__/task-cancel.test.ts(5 cases):previousStatuson a normal cancel, a completed task keeps its result andcompletedAt, the CLI prints the previous status, and the CLI exits 1 for an unknown id and for an already-finished task. All 5 fail onmainand pass with this change.task-list-totalandstatus-tasks-allstill pass.AI-assistance note: I prepared this change with help from an AI coding assistant, then reviewed it and ran the tests myself.